feat: table search form visible control (#5121)

* feat: table search form visible control

* chore: fix docs and demo

* chore: type error fixed
This commit is contained in:
Netfan
2024-12-12 22:28:03 +08:00
committed by GitHub
parent d308da6ba1
commit ed465d2b5b
10 changed files with 112 additions and 26 deletions

View File

@@ -82,6 +82,7 @@ const gridOptions: VxeGridProps<RowType> = {
},
},
},
showOverflow: false,
};
const [Grid] = useVbenVxeGrid({ gridOptions });

View File

@@ -1,6 +1,6 @@
<script lang="ts" setup>
import type { VbenFormProps } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { Page } from '@vben/common-ui';
@@ -71,7 +71,7 @@ const formOptions: VbenFormProps = {
submitOnEnter: false,
};
const gridOptions: VxeGridProps<RowType> = {
const gridOptions: VxeTableGridOptions<RowType> = {
checkboxConfig: {
highlight: true,
labelField: 'name',
@@ -85,6 +85,7 @@ const gridOptions: VxeGridProps<RowType> = {
{ field: 'price', title: 'Price' },
{ field: 'releaseDate', formatter: 'formatDateTime', title: 'Date' },
],
exportConfig: {},
height: 'auto',
keepSource: true,
pagerConfig: {},
@@ -100,9 +101,20 @@ const gridOptions: VxeGridProps<RowType> = {
},
},
},
toolbarConfig: {
custom: true,
export: true,
refresh: true,
resizable: true,
search: true,
zoom: true,
},
};
const [Grid] = useVbenVxeGrid({ formOptions, gridOptions });
const [Grid] = useVbenVxeGrid({
formOptions,
gridOptions,
});
</script>
<template>