element的el-row属性
时间: 2024-02-21 10:54:24 浏览: 21
element的el-row属性是用于布局的,可以将el-col包裹在el-row中,实现栅格布局。el-row可以设置样式,如边框、宽度、高度等。同时,el-row还可以通过设置:gutter属性来控制el-col之间的间隔。
以下是两个el-row的例子:
1.一个el-row包含一个el-col,没有间隔:
```html
<el-row style="border:1px solid #333;width:300px;height:102px">
<el-col :span="24">
<div style="background:red;height:100px"></div>
</el-col>
</el-row>
```
2.一个el-row包含两个el-col,中间有20px的间隔:
```html
<el-row :gutter="20" style="border:1px solid #333;width:300px;height:102px">
<el-col :span="12">
<div style="background:red;height:100px"></div>
</el-col>
<el-col :span="12">
<div style="background:yellow;height:100px"></div>
</el-col>
</el-row>
```