Skip to content

Commit

Permalink
feat: 完善前端文档
Browse files Browse the repository at this point in the history
  • Loading branch information
kanyxmo committed Oct 29, 2024
1 parent a910867 commit 5852741
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 56 deletions.
8 changes: 4 additions & 4 deletions .vitepress/theme/styles/element.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
}


.vp-doc table {
.el-table table {
margin: 0;
}

.vp-doc tr {
.el-table tr {
margin-top: 0; border: none;
}

.vp-doc th, .vp-doc td {
.el-table th, .el-table td {
border: 0;
}

.vp-doc tr:nth-child(2n) {
.el-table tr:nth-child(2n) {
background-color: transparent;
}
46 changes: 46 additions & 0 deletions docs/demos/ma-table/base/index.vue
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>
50 changes: 0 additions & 50 deletions docs/demos/ma-table/useTable/index.vue

This file was deleted.

5 changes: 3 additions & 2 deletions docs/zh/front/component/ma-table.md
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/" />

0 comments on commit 5852741

Please sign in to comment.