【更新】表格一个优化嵌套表格下的JSON转换问题

This commit is contained in:
俞宝山
2025-12-28 23:09:25 +08:00
parent 4b2f5ed091
commit b707f56e1e

View File

@@ -103,10 +103,6 @@
(record, index) => (data.localSettings.rowClassNameSwitch ? ((index + 1) % 2 == 0 ? 'odd' : '') : null)
"
>
<template #headerCell="{ title, column }">
<slot v-if="slots.headerCell" name="headerCell" :column="column" :title="title"></slot>
<template v-else>{{ title }}</template>
</template>
<template #[item]="scope" v-for="item in renderSlots">
<slot
v-if="item && renderTableProps.columns && renderTableProps.columns.length > 0"
@@ -128,9 +124,7 @@
const slots = useSlots()
const route = useRoute()
const emit = defineEmits(['onExpand', 'onSelectionChange'])
// 过滤掉headerCell插槽因为我们显式定义了它
const renderSlots = computed(() => Object.keys(slots).filter((key) => key !== 'headerCell'))
const renderSlots = Object.keys(slots)
// 是否存在 operator 插槽内容(过滤掉空白、注释、空 Fragment
const hasOperatorContent = computed(() => {
const s = slots.operator