el-row代表行,里面嵌套el-col,

el-row里面有gutter属性,属性为数字,则gutter前面加冒号,gutter属性代表el-col的间隔

el-col里面有span属性,span为x,则分成24/x列

el-col里必须有div,不然span分割无效

例子:

<template>
<div>
<el-row :gutter="20">
  <el-col :span="6"><div class="test">1</div></el-col>
  <el-col :span="6"><div class="test">1</div></el-col>
  <el-col :span="6"><div class="test">1</div></el-col>
  <el-col :span="6"><div class="test">1</div></el-col>
</el-row>
</div>
</template>
<script>
export default {
  name: "HelloWolrd",
  data () {
    return {
    };
  }
}
</script>
<style lang="css" scoped>
.test{
  background-color: red;
  color: #fff;
}
</style>

效果:

elementUI的栅格布局

 

相关文章:

  • 2021-11-17
  • 2021-10-31
  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-25
  • 2021-09-02
  • 2021-10-26
  • 2021-09-28
  • 2022-01-21
  • 2022-01-10
相关资源
相似解决方案