mirror of
https://github.com/dataease/dataease.git
synced 2025-02-27 22:15:43 +08:00
24 lines
514 B
Vue
24 lines
514 B
Vue
![]() |
<script>
|
||
|
export default {
|
||
|
name: "TableBody",
|
||
|
functional: true,
|
||
|
props: {
|
||
|
columns: {
|
||
|
type: Array,
|
||
|
default: () => [],
|
||
|
},
|
||
|
},
|
||
|
render(h, context) {
|
||
|
const nodes = [];
|
||
|
const { columns } = context.props;
|
||
|
const { children = [] } = context;
|
||
|
if (!columns?.length) return children;
|
||
|
children.forEach(ele => {
|
||
|
if (columns.includes(ele.componentOptions.propsData.prop)) {
|
||
|
nodes.push(ele)
|
||
|
}
|
||
|
})
|
||
|
return nodes;
|
||
|
},
|
||
|
};
|
||
|
</script>
|