diff --git a/demo/demo.vue b/demo/demo.vue index a574663..6de1e7f 100644 --- a/demo/demo.vue +++ b/demo/demo.vue @@ -4,8 +4,15 @@ - - + + n1 diff --git a/src/components/column/index.vue b/src/components/column/index.vue index 47abfce..cf4f556 100644 --- a/src/components/column/index.vue +++ b/src/components/column/index.vue @@ -12,7 +12,7 @@
@@ -32,9 +32,10 @@ diff --git a/src/components/column/props.ts b/src/components/column/props.ts index f4c3178..bc34244 100644 --- a/src/components/column/props.ts +++ b/src/components/column/props.ts @@ -1,5 +1,6 @@ import Variables from '@/constants/vars'; import RowItem from '@/models/data/row'; +import { type PropType } from 'vue'; export default { /** @@ -20,6 +21,15 @@ export default { */ label: String, + /** + * 是否合并,一个函数,抛出当前数据,接收true / false,true为合并当前行,与前置列合并 + */ + merge: { + type: [Function, Boolean] as PropType boolean)>, + default: () => false + }, + // ********* 内部参数 ********* // - data: RowItem + data: RowItem, + __index: Number }; diff --git a/src/components/column/util.ts b/src/components/column/util.ts index bafd7a7..19f1800 100644 --- a/src/components/column/util.ts +++ b/src/components/column/util.ts @@ -1,3 +1,3 @@ export const getColumnWidth = (width: number | string) => { - return `${typeof width === 'number' ? width : Number.parseInt(width)}px`; + return typeof width === 'number' ? width : Number.parseInt(width); }; diff --git a/src/components/common/TableBody.vue b/src/components/common/TableBody.vue index ae23c1e..b0b5351 100644 --- a/src/components/common/TableBody.vue +++ b/src/components/common/TableBody.vue @@ -43,8 +43,13 @@ ...$styleBox.getBorderColor() }" > -