This commit is contained in:
Shikong 2023-07-13 02:13:10 +08:00
parent 9fd888d5ff
commit a895f23058
2 changed files with 15 additions and 2 deletions

View File

@ -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)
})
</script>
<template>
@ -80,7 +94,7 @@ function addTab(){
</div>
<el-button @click="switchLocale()">切换 locale</el-button>
<el-table mb-1 :data="[]" />
<el-table-v2 mb-1 :data="[]" :columns="table.columns"/>
<el-pagination :total="100" />
<el-button @click="addTab()">添加tab</el-button>

View File

@ -1,7 +1,6 @@
<script setup>
import TabScaffold from "src/components/scaffold/TabScaffold.vue";
import {useRoute, useRouter} from "vue-router";
import {ref} from "vue";
import {useGlobalTabs} from "src/store/globalTabs";
const route = useRoute();
const router = useRouter();