|
@@ -9,7 +9,7 @@ const propOpts = inject(symbolKeys.body, {
|
|
|
childrenField: "children",
|
|
childrenField: "children",
|
|
|
bodyClass: "fw-semibold text-gray-600"
|
|
bodyClass: "fw-semibold text-gray-600"
|
|
|
})
|
|
})
|
|
|
-const orgh = 0
|
|
|
|
|
|
|
+const depth = 0
|
|
|
const rows = inject(symbolKeys.displayData, ref([]))
|
|
const rows = inject(symbolKeys.displayData, ref([]))
|
|
|
const tbody = ref<HTMLElement>()
|
|
const tbody = ref<HTMLElement>()
|
|
|
const hasChildren = (row: any) => {
|
|
const hasChildren = (row: any) => {
|
|
@@ -19,7 +19,7 @@ const hasChildren = (row: any) => {
|
|
|
<template>
|
|
<template>
|
|
|
<tbody v-if="rows?.length > 0" ref="tbody" :class="propOpts.bodyClass">
|
|
<tbody v-if="rows?.length > 0" ref="tbody" :class="propOpts.bodyClass">
|
|
|
<template v-for="(row, i) in rows" :key="i">
|
|
<template v-for="(row, i) in rows" :key="i">
|
|
|
- <BodyTr :row="row" :orgh="orgh" :index="i + 1">
|
|
|
|
|
|
|
+ <BodyTr :row="row" :depth="depth" :index="i + 1">
|
|
|
<template v-for="(_, name) in $slots" #[name]="{ row }">
|
|
<template v-for="(_, name) in $slots" #[name]="{ row }">
|
|
|
<slot :name="name" :row="row" />
|
|
<slot :name="name" :row="row" />
|
|
|
</template>
|
|
</template>
|
|
@@ -29,7 +29,7 @@ const hasChildren = (row: any) => {
|
|
|
:index="i + 1"
|
|
:index="i + 1"
|
|
|
:rows="row[propOpts.childrenField]"
|
|
:rows="row[propOpts.childrenField]"
|
|
|
:childrenField="propOpts.childrenField"
|
|
:childrenField="propOpts.childrenField"
|
|
|
- :orgh="orgh + 1">
|
|
|
|
|
|
|
+ :depth="depth + 1">
|
|
|
<template v-for="(_, name) in $slots" #[name]="{ row }">
|
|
<template v-for="(_, name) in $slots" #[name]="{ row }">
|
|
|
<slot :name="name" :row="row" />
|
|
<slot :name="name" :row="row" />
|
|
|
</template>
|
|
</template>
|