From 7c5326b7d2deb493ff1e5cccb7075af7d86b664b Mon Sep 17 00:00:00 2001 From: hechang27-sprt Date: Wed, 25 Mar 2026 18:08:03 +0800 Subject: [PATCH] feat: enhance list-table-v2 with timestamp support and matches styling with list-table-v1 - Add Vue JSX support via @vitejs/plugin-vue-jsx - Configure tsconfig for Vue JSX (jsx: preserve, jsxImportSource: vue) - Add TzDateTime component integration for timestamp columns - Support flexible timestamp type: undefined | boolean | string | object - Add rowHeight and estimatedRowHeight props - Replace previous column attribute `code` with `key` and `dataKey` (`key` for slot/display, `dataKey` for data access) Co-Authored-By: Claude Opus 4.6 --- examples/view/base/table-v2.vue | 14 +-- package.json | 1 + packages/base/data/list-table-v2.vue | 138 ++++++++++++++++++++++----- tsconfig.json | 1 + vite.config.ts | 2 + 5 files changed, 127 insertions(+), 29 deletions(-) diff --git a/examples/view/base/table-v2.vue b/examples/view/base/table-v2.vue index ccd09ae..023dfb5 100644 --- a/examples/view/base/table-v2.vue +++ b/examples/view/base/table-v2.vue @@ -60,29 +60,29 @@ const data = reactive({ const columns = [ { - code: "id", + key: "id", name: "ID", }, { - code: "caseName", + key: "caseName", i18n: "table.props.0", }, { - code: "taskName", + key: "taskName", i18n: "table.props.1", }, { - code: "userId", + key: "userId", i18n: "table.props.2", }, { - code: "content", + key: "content", i18n: "table.props.3", }, { - code: "createTime", + key: "createTime", i18n: "table.props.4", - timestamp: true, + timestamp: 'unix', }, ]; diff --git a/package.json b/package.json index 87fe401..e7b8c22 100644 --- a/package.json +++ b/package.json @@ -108,6 +108,7 @@ "@types/lodash-es": "^4.17.12", "@vitejs/plugin-legacy": "^7.2.1", "@vitejs/plugin-vue": "^6.0.3", + "@vitejs/plugin-vue-jsx": "^5.1.5", "@vue/cli-plugin-babel": "~5.0.9", "@vue/cli-plugin-router": "~5.0.9", "@vue/cli-plugin-typescript": "~5.0.9", diff --git a/packages/base/data/list-table-v2.vue b/packages/base/data/list-table-v2.vue index da5efd2..bb5cee1 100644 --- a/packages/base/data/list-table-v2.vue +++ b/packages/base/data/list-table-v2.vue @@ -9,8 +9,9 @@ :data="pageData" :width="width" :height="resolvedHeight(height)" - :row-height="rowHeight" - :header-height="headerHeight" + :row-height="prop.rowHeight" + :header-height="rowHeight" + :estimated-row-height="prop.estimatedRowHeight" :border="border" :row-key="rowKey" :class="border ? 'has-border' : ''" @@ -36,12 +37,13 @@ -