feat: 插件新增依赖注入功能
parent
5c02057198
commit
6da3017dcf
|
|
@ -1,24 +1,20 @@
|
||||||
import type { VxeTableGridOptions } from '@vben/plugins/vxe-table';
|
import type { VxeTableGridOptions } from "@vben/plugins/vxe-table";
|
||||||
import type { Recordable } from '@vben/types';
|
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 { IconifyIcon } from "@vben/icons";
|
||||||
import { $te } from '@vben/locales';
|
import { $te } from "@vben/locales";
|
||||||
import {
|
import { get, isFunction, isString } from "@vben/utils";
|
||||||
setupVbenVxeTable,
|
|
||||||
useVbenVxeGrid as useGrid,
|
|
||||||
} from '@vben/plugins/vxe-table';
|
|
||||||
import { get, isFunction, isString } from '@vben/utils';
|
|
||||||
|
|
||||||
import { objectOmit } from '@vueuse/core';
|
import { objectOmit } from "@vueuse/core";
|
||||||
import { Button, Image, Popconfirm, Switch, Tag } from 'ant-design-vue';
|
import { Button, Image, Popconfirm, Switch, Tag } from "ant-design-vue";
|
||||||
|
|
||||||
import { $t } from '#/locales';
|
|
||||||
|
|
||||||
import { useVbenForm } from './form';
|
import { $t } from "#/locales";
|
||||||
|
|
||||||
setupVbenVxeTable({
|
setupVbenVxeTable({
|
||||||
configVxeTable: (vxeUI) => {
|
configVxeTable: (vxeUI) => {
|
||||||
|
|
@ -281,7 +277,6 @@ setupVbenVxeTable({
|
||||||
// 这里可以自行扩展 vxe-table 的全局配置,比如自定义格式化
|
// 这里可以自行扩展 vxe-table 的全局配置,比如自定义格式化
|
||||||
// vxeUI.formats.add
|
// vxeUI.formats.add
|
||||||
},
|
},
|
||||||
useVbenForm,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export const useVbenVxeGrid = <T extends Record<string, any>>(
|
export const useVbenVxeGrid = <T extends Record<string, any>>(
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import { createApp, watchEffect } from 'vue';
|
||||||
|
|
||||||
import { registerAccessDirective } from '@vben/access';
|
import { registerAccessDirective } from '@vben/access';
|
||||||
import { registerLoadingDirective } from '@vben/common-ui';
|
import { registerLoadingDirective } from '@vben/common-ui';
|
||||||
|
import { providePluginsOptions } from '@vben/plugins';
|
||||||
import { preferences } from '@vben/preferences';
|
import { preferences } from '@vben/preferences';
|
||||||
import { initStores } from '@vben/stores';
|
import { initStores } from '@vben/stores';
|
||||||
import '@vben/styles';
|
import '@vben/styles';
|
||||||
|
|
@ -13,7 +14,7 @@ import { $t, setupI18n } from '#/locales';
|
||||||
import { router } from '#/router';
|
import { router } from '#/router';
|
||||||
|
|
||||||
import { initComponentAdapter } from './adapter/component';
|
import { initComponentAdapter } from './adapter/component';
|
||||||
import { initSetupVbenForm } from './adapter/form';
|
import { initSetupVbenForm, useVbenForm } from './adapter/form';
|
||||||
import App from './app.vue';
|
import App from './app.vue';
|
||||||
import { initTimezone } from './timezone-init';
|
import { initTimezone } from './timezone-init';
|
||||||
|
|
||||||
|
|
@ -24,6 +25,11 @@ async function bootstrap(namespace: string) {
|
||||||
// 初始化表单组件
|
// 初始化表单组件
|
||||||
await initSetupVbenForm();
|
await initSetupVbenForm();
|
||||||
|
|
||||||
|
// 注入插件全局配置
|
||||||
|
providePluginsOptions({
|
||||||
|
form: { useVbenForm },
|
||||||
|
});
|
||||||
|
|
||||||
// 设置弹窗的默认配置
|
// 设置弹窗的默认配置
|
||||||
// setDefaultModalProps({
|
// setDefaultModalProps({
|
||||||
// fullscreenButton: false,
|
// fullscreenButton: false,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue