mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat(components): 新增表格属性配置
This commit is contained in:
35
src/components/common/data-table.vue
Normal file
35
src/components/common/data-table.vue
Normal file
@ -0,0 +1,35 @@
|
||||
<script setup lang="ts">
|
||||
import { useAttrs } from 'vue';
|
||||
import type { DataTableProps } from 'naive-ui';
|
||||
import type { CreateRowKey } from 'naive-ui/es/data-table/src/interface';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
|
||||
defineOptions({
|
||||
name: 'DataTable',
|
||||
inheritAttrs: false
|
||||
});
|
||||
|
||||
interface Props {
|
||||
rowKey?: CreateRowKey<any>;
|
||||
}
|
||||
|
||||
defineProps<Props>();
|
||||
|
||||
const { table } = useThemeStore();
|
||||
const attrs: DataTableProps = useAttrs();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NDataTable
|
||||
:bordered="table.bordered"
|
||||
:bottom-bordered="table.bottomBordered"
|
||||
:single-column="table.singleColumn"
|
||||
:single-line="table.singleLine"
|
||||
:size="table.size"
|
||||
:striped="table.striped"
|
||||
:row-key="rowKey"
|
||||
v-bind="attrs"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
Reference in New Issue
Block a user