From dfe2d372b307dcf8ac2e1b356b2e611ccc7adc5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E5=84=80=E5=BC=8F?= <854085467@qq.com> Date: Sun, 29 May 2022 15:07:19 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(all):=20update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/component/src/component/table/TableRow.vue | 6 ++++-- package/component/src/component/table/index.less | 6 +----- package/component/src/component/table/index.vue | 10 ++++++++++ 3 files changed, 15 insertions(+), 7 deletions(-) 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; + } +})