feat: 添加插件上下文和类型定义
- 创建了插件选项的 createContext 功能 - 定义了 VbenPluginsOptions 接口结构 - 添加了表单、模态框、消息和组件的插件选项接口 - 提供了插件选项的注入和提供功能pull/340/MERGE
parent
4c1e3b9548
commit
914711ae04
|
|
@ -0,0 +1,6 @@
|
||||||
|
import type { VbenPluginsOptions } from './types';
|
||||||
|
|
||||||
|
import { createContext } from '@vben-core/shadcn-ui';
|
||||||
|
|
||||||
|
export const [injectPluginsOptions, providePluginsOptions] =
|
||||||
|
createContext<VbenPluginsOptions>('VbenPluginsOptions');
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
import type { Component } from 'vue';
|
||||||
|
|
||||||
|
export interface VbenPluginsFormOptions {
|
||||||
|
useVbenForm: (...args: any[]) => any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface VbenPluginsModalOptions {
|
||||||
|
useVbenModal?: () => any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface VbenPluginsMessageOptions {
|
||||||
|
useMessage?: () => any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface VbenPluginsComponentsOptions {
|
||||||
|
[key: string]: Component;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface VbenPluginsOptions {
|
||||||
|
form?: VbenPluginsFormOptions;
|
||||||
|
modal?: VbenPluginsModalOptions;
|
||||||
|
message?: VbenPluginsMessageOptions;
|
||||||
|
components?: VbenPluginsComponentsOptions;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue