table的列是不定项的,会出现一些多余的无效列,列里面都写的无效
<el-table ref="crossTable" :data="crossDatalist" border style="width: 100%" v-loading="listLoading"
fit size="mini" :show-header="false" v-if="crossDatalist.length>0">
<el-table-column align="center" prop="p0"></el-table-column>
<el-table-column align="center" prop="p1"></el-table-column>
<el-table-column align="center" prop="p2"></el-table-column>
<el-table-column align="center" prop="p3"></el-table-column>
<el-table-column align="center" prop="p4"></el-table-column>
<el-table-column align="center" prop="p5"></el-table-column>
<el-table-column align="center" prop="p6"></el-table-column>
<el-table-column align="center" prop="p7"></el-table-column>
<el-table-column align="center" prop="p8"></el-table-column>
<el-table-column align="center" prop="p9"></el-table-column>
<el-table-column align="center" v-if="isshow10">
<template slot-scope="scope" v-if="isshow(10,scope.row.p10)">
{{scope.row.p10}}
</template>
</el-table-column>
</el-table>
通过列v-if去调用方法,触发了列的v-if的值
methods: {
isshow(num, val) {
if (val == '无效') {
if (num == 10) {
this.isshow10 = false
}
return false;
}
return true;
}
}
博客提到table列是不定项的,存在多余无效列。通过列v-if调用方法来触发列的v-if值,主要围绕前端table列的处理及v-if的运用。
448

被折叠的 条评论
为什么被折叠?



