From a895f230583b500ef5f07d83732ae22eba7337f2 Mon Sep 17 00:00:00 2001 From: Shikong <919411476@qq.com> Date: Thu, 13 Jul 2023 02:13:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/wails/frontend/src/views/home/Home.vue | 16 +++++++++++++++- app/wails/frontend/src/views/home/index.vue | 1 - 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/wails/frontend/src/views/home/Home.vue b/app/wails/frontend/src/views/home/Home.vue index b17842b..5d0818a 100644 --- a/app/wails/frontend/src/views/home/Home.vue +++ b/app/wails/frontend/src/views/home/Home.vue @@ -63,6 +63,20 @@ function addTab(){ }) globalTabState.tab = "/test" } + +const generateColumns = (length = 10, prefix = 'column-', props) => +Array.from({ length }).map((_, columnIndex) => ({ + ...props, + key: `${prefix}${columnIndex}`, + dataKey: `${prefix}${columnIndex}`, + title: `Column ${columnIndex}`, + width: 150, +})) + +const table = reactive({ + columns: generateColumns(10) +}) +