From 3ca16bbee3fdd20215a99c8c25a8ad0a85b3a32f Mon Sep 17 00:00:00 2001 From: xuliangzhan Date: Mon, 15 Jul 2024 15:15:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E9=80=82=E5=BA=94=E5=88=97=E5=AE=BD?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=A4=B4=E9=83=A8=E5=92=8C=E5=B0=BE=E9=83=A8?= =?UTF-8?q?=20#2474?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/views/table/TableTest5.vue | 15 ++++++++++----- packages/table/src/table.ts | 2 +- styles/components/table.scss | 10 +++++++++- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/examples/views/table/TableTest5.vue b/examples/views/table/TableTest5.vue index 0e8763287e..ebcb0a4d0d 100644 --- a/examples/views/table/TableTest5.vue +++ b/examples/views/table/TableTest5.vue @@ -4,18 +4,20 @@ border stripe resizable - highlight-hover-row + show-footer height="400" + :row-config="{isHover: true}" :loading="demo1.loading" :checkbox-config="{labelField: 'id', highlight: true, range: true}" - :data="demo1.tableData"> + :data="demo1.tableData" + :footer-data="demo1.footerData"> - + - + @@ -25,7 +27,10 @@ import { onMounted, reactive } from 'vue' const demo1 = reactive({ loading: false, - tableData: [] as any[] + tableData: [] as any[], + footerData: [ + { name: 'xxx xxx x xxx xxx xxxx xxx xxxx xxx xxxx xxx xxxx xxx xxxx xxx x', address: 'xxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xx' } + ] }) onMounted(() => { diff --git a/packages/table/src/table.ts b/packages/table/src/table.ts index f62467f34e..b613f6cb5b 100644 --- a/packages/table/src/table.ts +++ b/packages/table/src/table.ts @@ -1103,7 +1103,7 @@ export default defineComponent({ const el = refElem.value if (el) { autoWidthColumnList.forEach(column => { - const cellElList = el.querySelectorAll(`.vxe-body--column.${column.id}>.vxe-cell`) + const cellElList = el.querySelectorAll(`.vxe-header--column.${column.id}>.vxe-cell,.vxe-body--column.${column.id}>.vxe-cell,.vxe-footer--column.${column.id}>.vxe-cell`) const firstCellEl = cellElList[0] let paddingSize = 0 if (firstCellEl) { diff --git a/styles/components/table.scss b/styles/components/table.scss index 5e473b5e4b..990efe2203 100644 --- a/styles/components/table.scss +++ b/styles/components/table.scss @@ -319,7 +319,8 @@ .vxe-table { &.column--calc { .vxe-header--column, - .vxe-body--column { + .vxe-body--column, + .vxe-footer--column { .vxe-cell { word-break: break-all; white-space: nowrap; @@ -644,6 +645,13 @@ user-select: none; } } + &.checkbox--range { + .vxe-body--column { + &.col--checkbox { + user-select: none; + } + } + } .vxe-header--column, .vxe-body--column, .vxe-footer--column {