feat: pure-table添加动态表头示例

This commit is contained in:
xiaoxian521
2024-09-23 14:45:02 +08:00
parent ab39864ef4
commit 0004f1318c
5 changed files with 91 additions and 6 deletions

View File

@@ -0,0 +1,25 @@
<script setup lang="ts">
import { ref } from "vue";
import { useColumns } from "./columns";
const tableRef = ref();
const { columns, dataList, onChange } = useColumns();
</script>
<template>
<div>
<el-button type="primary" class="mb-[20px]" @click="onChange">
切换表头
</el-button>
<pure-table
ref="tableRef"
border
row-key="id"
alignWhole="center"
showOverflowTooltip
:data="dataList"
:columns="columns"
/>
</div>
</template>