<!--
* @Descripttion: 封装动态表头
* @version:
* @Author: zhangfan
* @Date: 2020-07-03 17:35:37
* @LastEditors: zhangfan
* @LastEditTime: 2020-07-15 11:32:58
-->
<template>
<el-table-column :prop="col.prop" :fixed="col.prop==='date'" :width="col.prop==='date'?350:'auto'" :label="col.label" v-if="col.isShow" align="center">
<template v-if="col.children">
<el-table-column
v-for="(items,indexs) in activeUser"
:key="indexs"
:min-width="items.prop==='industryName'||items.prop==='investmentName'?100:150"
:prop="items.prop"
:label="items.label"
></el-table-column>
</template>
</el-table-column>
</template>
<script>
export default {
name: "MyColumn",
props: {
col: {
type: Object
}
},
computed: {
activeUser: function() {
const vm = this;
if (vm.col.children) {
let users = vm.col.children;
return users.filter(function(user) {
return user.isShow;
});
}
}
}
};
</script>
<style scoped>
</style>