mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-15 14:03:36 +08:00
feat: pure-table添加动态表头示例
This commit is contained in:
25
src/views/table/high/header/index.vue
Normal file
25
src/views/table/high/header/index.vue
Normal 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>
|
||||
Reference in New Issue
Block a user