update BaseTable

This commit is contained in:
2022-08-22 15:16:22 +08:00
parent 69dda72fab
commit 9a22601f5b
3 changed files with 95 additions and 7 deletions

View File

@@ -17,15 +17,15 @@
<!-- 普通的表头 -->
<el-table-column
v-else
:key="idx+'else'"
:key="idx + 'else'"
:label="head.label ? head.label : head.name"
:prop="head.prop"
:width="head.width"
:min-width="head.minWidth"
:fixed="head.fixed"
:prop="head.prop || null"
:width="head.width || null"
:min-width="head.minWidth || null"
:fixed="head.fixed || null"
:show-overflow-tooltip="head.showOverflowTooltip || false"
filter-placement="top"
:align="head.align"
:align="head.align || null"
v-bind="head.more"
>
<!-- 子组件 -->
@@ -34,6 +34,11 @@
<!-- 直接展示数据或应用过滤器 -->
<span v-else>{{ scope.row[head.prop] | commonFilter(head.filter) }}</span>
</template>
<!-- 多级表头 -->
<template v-if="!head.prop && head.children">
<TableHead v-for="(subhead, subindex) in head.children" :key="'subhead-' + idx + '-subindex-' + subindex" :opt="subhead" />
</template>
</el-table-column>
</template>
</el-table>
@@ -41,6 +46,7 @@
</template>
<script>
import TableHead from './components/table-head.vue'
export default {
name: 'BaseTable',
props: {
@@ -69,6 +75,7 @@ export default {
handleSubEmitData(payload) {
this.$emit('operate-event', payload)
}
}
},
components: { TableHead }
}
</script>