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