elementUI的栅格布局


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>

效果:

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM