目前发现两种情况自适应的不好
1.如果有合计,合计列较长,会换行
2.如果有筛选,筛选图标会换行
再次发现一个bug
1.存在多级表头的时候无法使用
2.嵌入到el-table-column之后再使用v-if,不会随着变量更新而更新
针对多级表头,可以判断嵌套,这种情况下自适应就是随缘,适应的不太好
<el-table ref="table" v-loading="loading" :data="tableData" border>
<template v-for="col1 in tableCols">
<el-table-column v-if="col1.children" :key="col1.key" :min-width="col1.width" :label="col1.label" :prop="col1.key">
<template v-for="col2 in col1.children">
<el-table-column v-if="col2.children" :key="col2.key" :label="col2.label" :prop="col2.key">
<template v-if="col2.children">
<af-table-column v-for="col3 in col2.children" :key="col3.key" :label="col3.label" :prop="col3.key" :width="col3.width" />
</template>
</el-table-column>
<af-table-column v-else :key="col2.key" :