-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs: init vxe-table demos * style: fix vxe-table index.scss import error * docs: fix vxe-table style & theme toggle problem * docs: add rest demos * docs: add vxe-table demo desc * fix: add maximumFileSizeToCacheInBytes to fix build error * fix: fix vxe-table set-theme build error * docs: fix vitepress ssr render problem * docs: add some tips for vitepress compatibility
- Loading branch information
1 parent
6b54cb7
commit 33ce4d3
Showing
21 changed files
with
1,529 additions
and
36 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
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
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 +1,2 @@ | ||
export * from './form'; | ||
export * from './vxe-table'; |
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 @@ | ||
export type * from '@vben/plugins/vxe-table'; |
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,93 @@ | ||
<script lang="ts" setup> | ||
import type { | ||
UseVbenVxeGrid, | ||
VxeGridListeners, | ||
VxeGridProps, | ||
} from '#/adapter/vxe-table'; | ||
import { inject } from 'vue'; | ||
import { Button, message } from 'ant-design-vue'; | ||
import { MOCK_TABLE_DATA } from '../table-data'; | ||
interface RowType { | ||
address: string; | ||
age: number; | ||
id: number; | ||
name: string; | ||
nickname: string; | ||
role: string; | ||
} | ||
const useVbenVxeGrid = inject<UseVbenVxeGrid>( | ||
'useVbenVxeGrid', | ||
) as UseVbenVxeGrid; | ||
const gridOptions: VxeGridProps<RowType> = { | ||
columns: [ | ||
{ title: '序号', type: 'seq', width: 50 }, | ||
{ field: 'name', title: 'Name' }, | ||
{ field: 'age', sortable: true, title: 'Age' }, | ||
{ field: 'nickname', title: 'Nickname' }, | ||
{ field: 'role', title: 'Role' }, | ||
{ field: 'address', showOverflow: true, title: 'Address' }, | ||
], | ||
data: MOCK_TABLE_DATA, | ||
pagerConfig: { | ||
enabled: false, | ||
}, | ||
sortConfig: { | ||
multiple: true, | ||
}, | ||
}; | ||
const gridEvents: VxeGridListeners<RowType> = { | ||
cellClick: ({ row }) => { | ||
message.info(`cell-click: ${row.name}`); | ||
}, | ||
}; | ||
const [Grid, gridApi] = useVbenVxeGrid({ gridEvents, gridOptions }); | ||
const showBorder = gridApi.useStore((state) => state.gridOptions?.border); | ||
const showStripe = gridApi.useStore((state) => state.gridOptions?.stripe); | ||
function changeBorder() { | ||
gridApi.setGridOptions({ | ||
border: !showBorder.value, | ||
}); | ||
} | ||
function changeStripe() { | ||
gridApi.setGridOptions({ | ||
stripe: !showStripe.value, | ||
}); | ||
} | ||
function changeLoading() { | ||
gridApi.setLoading(true); | ||
setTimeout(() => { | ||
gridApi.setLoading(false); | ||
}, 2000); | ||
} | ||
</script> | ||
|
||
<template> | ||
<!-- 此处的`vp-raw` 是为了适配文档的展示效果,实际使用时不需要 --> | ||
<div class="vp-raw w-full"> | ||
<Grid> | ||
<template #toolbar-tools> | ||
<Button class="mr-2" type="primary" @click="changeBorder"> | ||
{{ showBorder ? '隐藏' : '显示' }}边框 | ||
</Button> | ||
<Button class="mr-2" type="primary" @click="changeLoading"> | ||
显示loading | ||
</Button> | ||
<Button class="mr-2" type="primary" @click="changeStripe"> | ||
{{ showStripe ? '隐藏' : '显示' }}斑马纹 | ||
</Button> | ||
</template> | ||
</Grid> | ||
</div> | ||
</template> |
Oops, something went wrong.