chore: add vxe-table toolbar example (#4765)

pull/48/MERGE
Vben 2024-10-29 22:47:15 +08:00 committed by GitHub
parent d23db32f04
commit e600d78cb9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 548 additions and 430 deletions

View File

@ -35,7 +35,6 @@
"dayjs": "catalog:", "dayjs": "catalog:",
"execa": "catalog:", "execa": "catalog:",
"find-up": "catalog:", "find-up": "catalog:",
"nanoid": "catalog:",
"ora": "catalog:", "ora": "catalog:",
"pkg-types": "catalog:", "pkg-types": "catalog:",
"prettier": "catalog:", "prettier": "catalog:",

View File

@ -13,8 +13,6 @@ export { default as colors } from 'chalk';
export { consola } from 'consola'; export { consola } from 'consola';
export * from 'execa'; export * from 'execa';
export { nanoid } from 'nanoid';
export { default as fs } from 'node:fs/promises'; export { default as fs } from 'node:fs/promises';
export { type PackageJson, readPackageJSON } from 'pkg-types'; export { type PackageJson, readPackageJSON } from 'pkg-types';

View File

@ -99,7 +99,7 @@
"node": ">=20.10.0", "node": ">=20.10.0",
"pnpm": ">=9.5.0" "pnpm": ">=9.5.0"
}, },
"packageManager": "pnpm@9.12.2", "packageManager": "pnpm@9.12.3",
"pnpm": { "pnpm": {
"peerDependencyRules": { "peerDependencyRules": {
"allowedVersions": { "allowedVersions": {

View File

@ -7,13 +7,15 @@ import { useVbenForm } from '@vben-core/form-ui';
import { import {
VxeButton, VxeButton,
VxeButtonGroup, VxeCheckbox,
// VxeFormGather, // VxeFormGather,
// VxeForm, // VxeForm,
// VxeFormItem, // VxeFormItem,
VxeIcon, VxeIcon,
VxeInput, VxeInput,
VxeLoading, VxeLoading,
VxeModal,
VxePager, VxePager,
// VxeList, // VxeList,
// VxeModal, // VxeModal,
@ -22,7 +24,7 @@ import {
// VxePulldown, // VxePulldown,
// VxeRadio, // VxeRadio,
// VxeRadioButton, // VxeRadioButton,
// VxeRadioGroup, VxeRadioGroup,
VxeSelect, VxeSelect,
VxeTooltip, VxeTooltip,
VxeUI, VxeUI,
@ -64,13 +66,12 @@ export function initVxeTable() {
VxeUI.component(VxeTable); VxeUI.component(VxeTable);
VxeUI.component(VxeColumn); VxeUI.component(VxeColumn);
VxeUI.component(VxeColgroup); VxeUI.component(VxeColgroup);
VxeUI.component(VxeLoading);
VxeUI.component(VxeGrid); VxeUI.component(VxeGrid);
VxeUI.component(VxeToolbar); VxeUI.component(VxeToolbar);
VxeUI.component(VxeButton); VxeUI.component(VxeButton);
VxeUI.component(VxeButtonGroup); // VxeUI.component(VxeButtonGroup);
// VxeUI.component(VxeCheckbox); VxeUI.component(VxeCheckbox);
// VxeUI.component(VxeCheckboxGroup); // VxeUI.component(VxeCheckboxGroup);
VxeUI.component(createVirtualComponent('VxeForm')); VxeUI.component(createVirtualComponent('VxeForm'));
// VxeUI.component(VxeFormGather); // VxeUI.component(VxeFormGather);
@ -79,14 +80,14 @@ export function initVxeTable() {
VxeUI.component(VxeInput); VxeUI.component(VxeInput);
// VxeUI.component(VxeList); // VxeUI.component(VxeList);
VxeUI.component(VxeLoading); VxeUI.component(VxeLoading);
// VxeUI.component(VxeModal); VxeUI.component(VxeModal);
// VxeUI.component(VxeOptgroup); // VxeUI.component(VxeOptgroup);
// VxeUI.component(VxeOption); // VxeUI.component(VxeOption);
VxeUI.component(VxePager); VxeUI.component(VxePager);
// VxeUI.component(VxePulldown); // VxeUI.component(VxePulldown);
// VxeUI.component(VxeRadio); // VxeUI.component(VxeRadio);
// VxeUI.component(VxeRadioButton); // VxeUI.component(VxeRadioButton);
// VxeUI.component(VxeRadioGroup); VxeUI.component(VxeRadioGroup);
VxeUI.component(VxeSelect); VxeUI.component(VxeSelect);
// VxeUI.component(VxeSwitch); // VxeUI.component(VxeSwitch);
// VxeUI.component(VxeTextarea); // VxeUI.component(VxeTextarea);

View File

@ -81,3 +81,11 @@
.vxe-pager--wrapper { .vxe-pager--wrapper {
@apply justify-center md:justify-end; @apply justify-center md:justify-end;
} }
.vxe-tools--operate {
@apply ml-3;
}
.vxe-table-custom--checkbox-option:hover {
background: none !important;
}

View File

@ -122,6 +122,11 @@ const options = computed(() => {
toolbarOptions.value, toolbarOptions.value,
toRaw(gridOptions.value), toRaw(gridOptions.value),
globalGridConfig, globalGridConfig,
{
// toolbarConfig: {
// tools: [],
// },
} as VxeTableGridProps,
), ),
); );

View File

@ -33,7 +33,6 @@ const gridOptions: VxeGridProps<RowType> = {
], ],
height: 'auto', height: 'auto',
keepSource: true, keepSource: true,
pagerConfig: {},
proxyConfig: { proxyConfig: {
ajax: { ajax: {
query: async ({ page }) => { query: async ({ page }) => {
@ -44,9 +43,18 @@ const gridOptions: VxeGridProps<RowType> = {
}, },
}, },
}, },
toolbarConfig: {
custom: true,
// export: true,
// import: true,
refresh: true,
zoom: true,
},
}; };
const [Grid, gridApi] = useVbenVxeGrid({ gridOptions }); const [Grid, gridApi] = useVbenVxeGrid({
gridOptions,
});
</script> </script>
<template> <template>

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,7 @@ catalog:
'@ctrl/tinycolor': ^4.1.0 '@ctrl/tinycolor': ^4.1.0
'@eslint/js': ^9.13.0 '@eslint/js': ^9.13.0
'@faker-js/faker': ^9.1.0 '@faker-js/faker': ^9.1.0
'@iconify/json': ^2.2.264 '@iconify/json': ^2.2.265
'@iconify/tailwind': ^1.1.3 '@iconify/tailwind': ^1.1.3
'@iconify/vue': ^4.1.2 '@iconify/vue': ^4.1.2
'@intlify/core-base': ^10.0.4 '@intlify/core-base': ^10.0.4
@ -42,13 +42,13 @@ catalog:
'@types/html-minifier-terser': ^7.0.2 '@types/html-minifier-terser': ^7.0.2
'@types/jsonwebtoken': ^9.0.7 '@types/jsonwebtoken': ^9.0.7
'@types/lodash.clonedeep': ^4.5.9 '@types/lodash.clonedeep': ^4.5.9
'@types/node': ^22.8.1 '@types/node': ^22.8.2
'@types/nprogress': ^0.2.3 '@types/nprogress': ^0.2.3
'@types/postcss-import': ^14.0.3 '@types/postcss-import': ^14.0.3
'@types/qrcode': ^1.5.5 '@types/qrcode': ^1.5.5
'@types/sortablejs': ^1.15.8 '@types/sortablejs': ^1.15.8
'@typescript-eslint/eslint-plugin': ^8.11.0 '@typescript-eslint/eslint-plugin': ^8.12.2
'@typescript-eslint/parser': ^8.11.0 '@typescript-eslint/parser': ^8.12.2
'@vee-validate/zod': ^4.14.6 '@vee-validate/zod': ^4.14.6
'@vite-pwa/vitepress': ^0.5.3 '@vite-pwa/vitepress': ^0.5.3
'@vitejs/plugin-vue': ^5.1.4 '@vitejs/plugin-vue': ^5.1.4
@ -97,8 +97,8 @@ catalog:
eslint-plugin-unicorn: ^56.0.0 eslint-plugin-unicorn: ^56.0.0
eslint-plugin-unused-imports: ^4.1.4 eslint-plugin-unused-imports: ^4.1.4
eslint-plugin-vitest: ^0.5.4 eslint-plugin-vitest: ^0.5.4
eslint-plugin-vue: ^9.29.1 eslint-plugin-vue: ^9.30.0
execa: ^9.5.0 execa: ^9.5.1
find-up: ^7.0.0 find-up: ^7.0.0
get-port: ^7.1.0 get-port: ^7.1.0
globals: ^15.11.0 globals: ^15.11.0
@ -111,10 +111,9 @@ catalog:
jsonwebtoken: ^9.0.2 jsonwebtoken: ^9.0.2
lint-staged: ^15.2.10 lint-staged: ^15.2.10
lodash.clonedeep: ^4.5.0 lodash.clonedeep: ^4.5.0
lucide-vue-next: ^0.453.0 lucide-vue-next: ^0.454.0
medium-zoom: ^1.1.0 medium-zoom: ^1.1.0
naive-ui: ^2.40.1 naive-ui: ^2.40.1
nanoid: ^5.0.7
nitropack: ^2.9.7 nitropack: ^2.9.7
nprogress: ^0.2.0 nprogress: ^0.2.0
ora: ^8.1.0 ora: ^8.1.0
@ -132,10 +131,10 @@ catalog:
prettier-plugin-tailwindcss: ^0.6.8 prettier-plugin-tailwindcss: ^0.6.8
publint: ^0.2.12 publint: ^0.2.12
qrcode: ^1.5.4 qrcode: ^1.5.4
radix-vue: ^1.9.7 radix-vue: ^1.9.8
resolve.exports: ^2.0.2 resolve.exports: ^2.0.2
rimraf: ^6.0.1 rimraf: ^6.0.1
rollup: ^4.24.1 rollup: ^4.24.2
rollup-plugin-visualizer: ^5.12.0 rollup-plugin-visualizer: ^5.12.0
sass: 1.79.5 sass: 1.79.5
sortablejs: ^1.15.3 sortablejs: ^1.15.3
@ -167,7 +166,7 @@ catalog:
vite-plugin-vue-devtools: ^7.5.4 vite-plugin-vue-devtools: ^7.5.4
vitepress: ^1.4.1 vitepress: ^1.4.1
vitepress-plugin-group-icons: ^1.3.0 vitepress-plugin-group-icons: ^1.3.0
vitest: ^2.1.3 vitest: ^2.1.4
vue: ^3.5.12 vue: ^3.5.12
vue-eslint-parser: ^9.4.3 vue-eslint-parser: ^9.4.3
vue-i18n: ^10.0.4 vue-i18n: ^10.0.4