diff --git a/playground/src/adapter/vxe-table.ts b/playground/src/adapter/vxe-table.ts index d3d647e5f..ec5711ebe 100644 --- a/playground/src/adapter/vxe-table.ts +++ b/playground/src/adapter/vxe-table.ts @@ -1,24 +1,20 @@ -import type { VxeTableGridOptions } from '@vben/plugins/vxe-table'; -import type { Recordable } from '@vben/types'; +import type { VxeTableGridOptions } from "@vben/plugins/vxe-table"; +import { setupVbenVxeTable, useVbenVxeGrid as useGrid } from "@vben/plugins/vxe-table"; +import type { Recordable } from "@vben/types"; -import type { ComponentType } from './component'; +import type { ComponentType } from "./component"; -import { h } from 'vue'; +import { h } from "vue"; -import { IconifyIcon } from '@vben/icons'; -import { $te } from '@vben/locales'; -import { - setupVbenVxeTable, - useVbenVxeGrid as useGrid, -} from '@vben/plugins/vxe-table'; -import { get, isFunction, isString } from '@vben/utils'; +import { IconifyIcon } from "@vben/icons"; +import { $te } from "@vben/locales"; +import { get, isFunction, isString } from "@vben/utils"; -import { objectOmit } from '@vueuse/core'; -import { Button, Image, Popconfirm, Switch, Tag } from 'ant-design-vue'; +import { objectOmit } from "@vueuse/core"; +import { Button, Image, Popconfirm, Switch, Tag } from "ant-design-vue"; -import { $t } from '#/locales'; -import { useVbenForm } from './form'; +import { $t } from "#/locales"; setupVbenVxeTable({ configVxeTable: (vxeUI) => { @@ -281,7 +277,6 @@ setupVbenVxeTable({ // 这里可以自行扩展 vxe-table 的全局配置,比如自定义格式化 // vxeUI.formats.add }, - useVbenForm, }); export const useVbenVxeGrid = >( diff --git a/playground/src/bootstrap.ts b/playground/src/bootstrap.ts index fed073400..1685a718b 100644 --- a/playground/src/bootstrap.ts +++ b/playground/src/bootstrap.ts @@ -2,6 +2,7 @@ import { createApp, watchEffect } from 'vue'; import { registerAccessDirective } from '@vben/access'; import { registerLoadingDirective } from '@vben/common-ui'; +import { providePluginsOptions } from '@vben/plugins'; import { preferences } from '@vben/preferences'; import { initStores } from '@vben/stores'; import '@vben/styles'; @@ -13,7 +14,7 @@ import { $t, setupI18n } from '#/locales'; import { router } from '#/router'; import { initComponentAdapter } from './adapter/component'; -import { initSetupVbenForm } from './adapter/form'; +import { initSetupVbenForm, useVbenForm } from './adapter/form'; import App from './app.vue'; import { initTimezone } from './timezone-init'; @@ -24,6 +25,11 @@ async function bootstrap(namespace: string) { // 初始化表单组件 await initSetupVbenForm(); + // 注入插件全局配置 + providePluginsOptions({ + form: { useVbenForm }, + }); + // 设置弹窗的默认配置 // setDefaultModalProps({ // fullscreenButton: false,