You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kaohe/ruoyi-ui/src/components/TableColumn/index.vue

26 lines
603 B

<template>
<el-table-column v-if="!isLeaf" :label="column.label" header-align="center">
<template v-for="child in column.children">
<table-column :key="child.label" :column="child" />
</template>
</el-table-column>
<el-table-column v-else :label="column.label" :prop="column.prop" header-align="center"/>
</template>
<script>
export default {
name: 'TableColumn',
props: {
column: Object
},
created() {
// console.log(this.column,9999);
},
computed: {
isLeaf() {
return !this.column.children || this.column.children.length === 0;
}
}
}
</script>