table 扩展


element ui提供的table组件支持扩展属性

        父子表中展示子表数据,可封装为子组件

二、如何使用

1:table使用扩展列,type=”expand“,只支持一个

2:支持table扩展Table建议为子组件传递主键进行查询

组件
<el-table-column type="expand" label="明细" min-width="9%" width="80px">
    <template v-slot="scope">
        <check-sub-list :check-id="scope.row.checkId" />
    </template>
</el-table-column&gt;
组件
<el-table :data="list" v-loading="loading"
          style="height: 80px;width: 90%;margin: 0 auto;" border>
    <el-table-column label="检测员" align="center" width="100">
        <template v-slot="scope">
            <select-tag :options="$store.state.cache.system.userSelect" :value="scope.row.checker" />
        </template>
    </el-table-column>
子组件参数
props: {
    checkId:{
        type: String,
        default: null
    },
},

子组件监听

checkId(val) {
    this.getList();
},
</el-table>

外层不要用fix

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注