-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
53 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<script setup lang="tsx"> | ||
import { ref } from 'vue' | ||
import type { MaTableColumns, MaTableExpose, MaTableOptions } from "@mineadmin/table" | ||
const tableRef = ref<MaTableExpose>() | ||
const columns = ref<MaTableColumns[]>([ | ||
{ | ||
label: '人员信息', prop: 'base', | ||
children: [ | ||
{ label: '姓名', prop: 'name' }, | ||
{ label: '所在部门', prop: 'dept' } | ||
] | ||
}, | ||
{ | ||
label: '应发薪资', prop: 'xinshui', | ||
sortable: true, | ||
cellRender:({ row }) => <el-tag>{ row.xinshui }</el-tag> | ||
}, | ||
{ label: '入职时间', prop: 'date' }, | ||
]) | ||
const options = ref<MaTableOptions>({ | ||
defaultSort: { prop: 'xinshui', order: 'descending' }, | ||
showSummary: true, | ||
sumText: '合计薪资', | ||
}) | ||
const data: any[] = [ | ||
{ name: '石昊', dept: '研发部', xinshui: 12365, date: '2021-08-04' }, | ||
{ name: '叶凡', dept: '销售部', xinshui: 13984, date: '2022-03-31' }, | ||
{ name: '罗峰', dept: '运营部', xinshui: 11288, date: '2022-04-05' }, | ||
{ name: '白小纯', dept: '研发部', xinshui: 9989, date: '2022-05-05' }, | ||
{ name: '林七夜', dept: '销售部', xinshui: 10258, date: '2022-06-05' }, | ||
{ name: '萧炎', dept: '销售部', xinshui: 13069, date: '2022-07-05' }, | ||
{ name: '陈平安', dept: '运营部', xinshui: 8750, date: '2022-08-05' }, | ||
{ name: '王林', dept: '研发部', xinshui: 11369, date: '2022-09-05' }, | ||
] | ||
</script> | ||
|
||
<template> | ||
<ma-table ref="tableRef" :columns="columns" :data="data" :options="options" /> | ||
</template> | ||
|
||
<style scoped> | ||
</style> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# MaTable | ||
|
||
基于 `Element plus` 的表格二次封装的 `Table` 组件,非常好用。 | ||
基于 `Element plus` 的表格二次封装的 `Table` 组件,支持所有原生表格参数、事件、插槽,同时增强了部分功能,非常好用。 | ||
|
||
<Preview dir="demos/ma-table/useTable/" /> | ||
## 基础使用 | ||
<Preview dir="demos/ma-table/base/" /> | ||
|