diff --git a/package/component/src/component/table/TableRow.vue b/package/component/src/component/table/TableRow.vue index 513439bb..06b3c889 100644 --- a/package/component/src/component/table/TableRow.vue +++ b/package/component/src/component/table/TableRow.vue @@ -9,6 +9,7 @@ import { computed, ref, useSlots, WritableComputedRef } from "vue"; import { Recordable } from "../../types"; export interface LayTableRowProps { + expandSpace: boolean; selectedKeys: Recordable[]; tableColumnKeys: Recordable[]; columns: Recordable[]; @@ -26,7 +27,7 @@ const emit = defineEmits([ ]); const props = withDefaults(defineProps(), { - checkbox: false + checkbox: false, }); const tableSelectedKeys: WritableComputedRef = computed({ @@ -166,6 +167,7 @@ const handleExpand = () => { :columns="columns" :checkbox="checkbox" :tableColumnKeys="tableColumnKeys" + :expandSpace="expandSpace" @row="rowClick" @row-double="rowDoubleClick" @contextmenu="contextmenu" @@ -180,4 +182,4 @@ const handleExpand = () => { - + \ No newline at end of file diff --git a/package/component/src/component/table/index.less b/package/component/src/component/table/index.less index ce4036d1..a7fcf039 100644 --- a/package/component/src/component/table/index.less +++ b/package/component/src/component/table/index.less @@ -362,11 +362,7 @@ border-radius: 2px; } -.layui-table-cell-expand-icon-none { - display: none; -} - -.layui-table-cell-expand-icon-hidden { +.layui-table-cell-expand-icon-spaced { visibility: hidden; } diff --git a/package/component/src/component/table/index.vue b/package/component/src/component/table/index.vue index 74f22577..f0c51008 100644 --- a/package/component/src/component/table/index.vue +++ b/package/component/src/component/table/index.vue @@ -207,6 +207,15 @@ props.columns.map((value: any) => { slotsData.value.push(value.customSlot); } }); + +// is tree +const childrenExpandSpace = ref(false); + +props.dataSource.map((value: any) => { + if(value.children) { + childrenExpandSpace.value = true; + } +})