diff --git a/package/component/src/component/checkbox/index.vue b/package/component/src/component/checkbox/index.vue index dd0b60d0..3d9c68ee 100644 --- a/package/component/src/component/checkbox/index.vue +++ b/package/component/src/component/checkbox/index.vue @@ -127,7 +127,13 @@ const isDisabled = computed(() => { >{{ label }} diff --git a/package/component/src/component/table/TableRow.vue b/package/component/src/component/table/TableRow.vue index 41088cad..9cc74fe5 100644 --- a/package/component/src/component/table/TableRow.vue +++ b/package/component/src/component/table/TableRow.vue @@ -84,17 +84,22 @@ const tableSelectedKey: WritableComputedRef = computed({ const isExpand: WritableComputedRef = computed({ get() { - return tableExpandAll.value ? true : tableExpandKeys.value.includes(props.data[props.id]); + return tableExpandAll.value + ? true + : tableExpandKeys.value.includes(props.data[props.id]); }, set(val) { - let newTableExpandKeys = [...tableExpandKeys.value] - if (!val) { - newTableExpandKeys.splice(newTableExpandKeys.indexOf(props.data[props.id]), 1); - } else { - newTableExpandKeys.push(props.data[props.id]); - } - tableExpandAll.value = false; - tableExpandKeys.value = newTableExpandKeys; + let newTableExpandKeys = [...tableExpandKeys.value]; + if (!val) { + newTableExpandKeys.splice( + newTableExpandKeys.indexOf(props.data[props.id]), + 1 + ); + } else { + newTableExpandKeys.push(props.data[props.id]); + } + tableExpandAll.value = false; + tableExpandKeys.value = newTableExpandKeys; }, }); diff --git a/package/component/src/component/table/index.vue b/package/component/src/component/table/index.vue index b59e5530..16658233 100644 --- a/package/component/src/component/table/index.vue +++ b/package/component/src/component/table/index.vue @@ -66,7 +66,7 @@ const props = withDefaults(defineProps(), { cellStyle: "", spanMethod: () => {}, defaultExpandAll: false, - expandKeys: () => [] + expandKeys: () => [], }); const tableId = uuidv4(); @@ -305,7 +305,10 @@ const getFixedColumn = () => { hasr.value = true; } else { // @ts-ignore - if (tableBody.value?.scrollLeft + tableBody.value?.offsetWidth + 2 > tableBody.value?.scrollWidth) { + if ( + tableBody.value?.scrollLeft + tableBody.value?.offsetWidth + 2 > + tableBody.value?.scrollWidth + ) { hasl.value = true; hasr.value = false; } else { diff --git a/package/document-component/src/document/zh-CN/components/table.md b/package/document-component/src/document/zh-CN/components/table.md index a1a2209d..75ef1cc2 100644 --- a/package/document-component/src/document/zh-CN/components/table.md +++ b/package/document-component/src/document/zh-CN/components/table.md @@ -817,79 +817,6 @@ export default { ::: -::: title 合并行列 -::: - -::: demo 通过 `columns` 配置 `type:'radio'` 开启单选列。 - - - - - -::: - ::: title 暂无数据 ::: @@ -1065,6 +992,162 @@ export default { ::: +::: title 合并行列 +::: + +::: demo 通过 `span-method` 属性, 自定义行列合并的逻辑。 + + + + + +::: + +::: title 行内编辑 +::: + +::: demo 通过 `span-method` 属性, 自定义行列合并的逻辑。 + + + + + +::: + ::: title 完整表格 :::