1. 左右子元素宽度自适应
<style lang=
"stylus">
.box
width 33%
.left
width auto
.right
flex 1
</style>
flex:1可以让其宽度填充满;不把宽度写死也是为了浏览器自适应
而width:auto是为了应对中英文切换带来的长度变化问题
2. el-table第一列空出一段距离使其不贴边
indexHeaderClass ({ row
, column
, rowIndex
, columnIndex
}) {
if (columnIndex
=== 0) {
return 'padding-left: 25px'
}
},
indexCellClass ({ row
, column
, rowIndex
, columnIndex
}) {
if (columnIndex
=== 0) {
return 'padding-left: 25px'
}
},
<el-table
:data="tableData"
:header-cell-style="indexHeaderClass"
:cell-style="indexCellClass"
style="width: 100%;height:100%">
<el-table-column v-for="(item,index) in titleDates" :key="index"
:prop="item.attr"
:label="item.name"
:width="item.width">
</el-table-column>
</el-table>
3. 注意字符串函数的写法
如不是subString 而是substring,不是像变量命名一样驼峰式
Smile and let everyone know that today you’re a lot stronger than you were yesterday. 用微笑告诉世人,今天的你比昨天更加强大。