|
@@ -33,11 +33,11 @@ const propsOpts = inject(symbolKeys.bodyTd, {
|
|
|
isLazy: false
|
|
isLazy: false
|
|
|
})
|
|
})
|
|
|
const tableBox = inject(symbolKeys.tableBox) as Ref<HTMLElement>
|
|
const tableBox = inject(symbolKeys.tableBox) as Ref<HTMLElement>
|
|
|
-
|
|
|
|
|
|
|
+const row = toRef(props.row)
|
|
|
const isLeaf = computed(() => {
|
|
const isLeaf = computed(() => {
|
|
|
return propsOpts.isLazy
|
|
return propsOpts.isLazy
|
|
|
- ? toBoolean(props.row[propsOpts.leafField])
|
|
|
|
|
- : !(props.row[propsOpts.childrenField] && props.row[propsOpts.childrenField].length > 0)
|
|
|
|
|
|
|
+ ? toBoolean(row.value[propsOpts.leafField])
|
|
|
|
|
+ : !(row.value[propsOpts.childrenField] && row.value[propsOpts.childrenField].length > 0)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const tooltip = computed(() => {
|
|
const tooltip = computed(() => {
|
|
@@ -70,19 +70,13 @@ const tdClass = computed(() => {
|
|
|
}
|
|
}
|
|
|
return classStr
|
|
return classStr
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
-const slotData = computed(() => {
|
|
|
|
|
- return Object.assign({}, props.row)
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
const onToggle = () => {
|
|
const onToggle = () => {
|
|
|
if (!isLeaf.value) {
|
|
if (!isLeaf.value) {
|
|
|
- VbUtil.EventHandlerUtil.trigger(tableBox.value, "vbtable.row.tree-toggle", props.row)
|
|
|
|
|
|
|
+ VbUtil.EventHandlerUtil.trigger(tableBox.value, "vbtable.row.tree-toggle", row.value)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
function init() {
|
|
function init() {
|
|
|
//
|
|
//
|
|
|
- //console.log("props ", propsOpts.isLazy)
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onMounted(init)
|
|
onMounted(init)
|
|
@@ -117,7 +111,7 @@ onMounted(init)
|
|
|
</template>
|
|
</template>
|
|
|
</span>
|
|
</span>
|
|
|
<template v-if="$slots[column.field]">
|
|
<template v-if="$slots[column.field]">
|
|
|
- <slot :name="`${column.field}`" :row="slotData"></slot>
|
|
|
|
|
|
|
+ <slot :name="`${column.field}`" :row="row"></slot>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else-if="column.field == configs.TABLE_INDEX_FIELD">
|
|
<template v-else-if="column.field == configs.TABLE_INDEX_FIELD">
|
|
|
{{ index }}
|
|
{{ index }}
|