From bbbee93929c03fe96441eb7a1beea0b1276e7fca Mon Sep 17 00:00:00 2001 From: zhanghl <253316343@qq.com> Date: 星期二, 15 四月 2025 14:25:42 +0800 Subject: [PATCH] 父子表组件封装 --- src/components/HxlhTable/index.vue | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletions(-) diff --git a/src/components/HxlhTable/index.vue b/src/components/HxlhTable/index.vue index 8de4a38..b181a21 100644 --- a/src/components/HxlhTable/index.vue +++ b/src/components/HxlhTable/index.vue @@ -26,6 +26,7 @@ :footer-cell-class-name="footerCellClassName" :scroll-x="{enabled: true}" :scroll-y="{enabled: true}" + :expand-config="expandConfig" @sort-change="sortChange" @page-change="pagerChange" @form-submit="findList" @@ -35,6 +36,10 @@ <template v-slot:buttons="row"> <slot name="buttons" v-bind="row"/> </template> + <template #expandContent="{ row }"> + <vxe-grid v-bind="subGridOptions" :data="row.subList"> + </vxe-grid> + </template> </vxe-grid> </div> </template> @@ -133,9 +138,22 @@ default: () => { return [] } -} +}, + expandConfig: { + type: Object, + default: () => { + return {lazy: false} + } + }, + subGridOptions: { + type:Object, + default :()=>{ + return {} + } + } }) + const tableForm = ref([]); // const url = computed(() => props.src) -- Gitblit v1.9.3