From 914711ae043051378c8f86a88ee7babab61f9cb2 Mon Sep 17 00:00:00 2001 From: Jin Mao Date: Wed, 25 Mar 2026 13:25:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E4=B8=8B=E6=96=87=E5=92=8C=E7=B1=BB=E5=9E=8B=E5=AE=9A?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 创建了插件选项的 createContext 功能 - 定义了 VbenPluginsOptions 接口结构 - 添加了表单、模态框、消息和组件的插件选项接口 - 提供了插件选项的注入和提供功能 --- .../effects/plugins/src/plugins-context.ts | 6 +++++ packages/effects/plugins/src/types.ts | 24 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 packages/effects/plugins/src/plugins-context.ts create mode 100644 packages/effects/plugins/src/types.ts diff --git a/packages/effects/plugins/src/plugins-context.ts b/packages/effects/plugins/src/plugins-context.ts new file mode 100644 index 000000000..0265f1919 --- /dev/null +++ b/packages/effects/plugins/src/plugins-context.ts @@ -0,0 +1,6 @@ +import type { VbenPluginsOptions } from './types'; + +import { createContext } from '@vben-core/shadcn-ui'; + +export const [injectPluginsOptions, providePluginsOptions] = + createContext('VbenPluginsOptions'); diff --git a/packages/effects/plugins/src/types.ts b/packages/effects/plugins/src/types.ts new file mode 100644 index 000000000..9a989784f --- /dev/null +++ b/packages/effects/plugins/src/types.ts @@ -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; +}