mirror of
https://github.com/imdap/ruoyi-plus-vben5.git
synced 2026-05-06 10:01:26 +08:00
feat: 添加插件上下文和类型定义
- 创建了插件选项的 createContext 功能 - 定义了 VbenPluginsOptions 接口结构 - 添加了表单、模态框、消息和组件的插件选项接口 - 提供了插件选项的注入和提供功能
This commit is contained in:
6
packages/effects/plugins/src/plugins-context.ts
Normal file
6
packages/effects/plugins/src/plugins-context.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { VbenPluginsOptions } from './types';
|
||||
|
||||
import { createContext } from '@vben-core/shadcn-ui';
|
||||
|
||||
export const [injectPluginsOptions, providePluginsOptions] =
|
||||
createContext<VbenPluginsOptions>('VbenPluginsOptions');
|
||||
24
packages/effects/plugins/src/types.ts
Normal file
24
packages/effects/plugins/src/types.ts
Normal file
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user