feat: add ample demos to @pureadmin/table (#379)

* feat: add ample demos to @pureadmin/table
This commit is contained in:
RealityBoy
2022-11-21 11:42:33 +08:00
committed by GitHub
parent 8ff242ea45
commit 9b62d6ef1e
46 changed files with 1859 additions and 48 deletions

View File

@@ -6,10 +6,11 @@ import { Switch, message } from "@pureadmin/components";
export function useColumns() {
const switchLoadMap = ref({});
const columns = ref([
const columns: TableColumnList = [
{
type: "selection",
width: 55,
align: "left",
hide: ({ checkList }) => !checkList.includes("勾选列")
},
{
@@ -65,7 +66,7 @@ export function useColumns() {
unCheckedValue={0}
checked-children="已开启"
un-checked-children="已关闭"
onChange={() => onChange(scope)}
onChange={() => onChange(scope as any)}
/>
)
},
@@ -82,7 +83,7 @@ export function useColumns() {
width: 180,
slot: "operation"
}
]);
];
function onChange({ row, index }) {
ElMessageBox.confirm(

View File

@@ -131,9 +131,9 @@ onMounted(() => {
</el-button>
</template>
<template v-slot="{ size, checkList }">
<PureTable
<pure-table
border
align="center"
align-whole="center"
table-layout="auto"
:size="size"
:data="dataList"
@@ -211,7 +211,7 @@ onMounted(() => {
</template>
</el-dropdown>
</template>
</PureTable>
</pure-table>
</template>
</TableProBar>
</div>