From c6fd599784a7a206c874517b008df9edffe22d19 Mon Sep 17 00:00:00 2001 From: "yuan.ji" <961999367@qq.com> Date: Mon, 27 Apr 2026 13:42:56 +0800 Subject: [PATCH] =?UTF-8?q?feat(@vben/plugins):=20=E8=A1=A5=E5=85=85=20tip?= =?UTF-8?q?tap=20=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E3=80=81=E5=B7=A5=E5=85=B7=E6=A0=8F=E5=92=8C=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 ImageUploadOptions 类型定义和 imageUpload 属性 - 工具栏图片按钮支持上传/URL 双模式 - playground 添加图片上传 mock 示例 --- packages/effects/plugins/src/tiptap/toolbar.ts | 6 +++++- packages/effects/plugins/src/tiptap/types.ts | 5 ++++- playground/src/views/examples/tiptap/index.vue | 10 ++++------ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/packages/effects/plugins/src/tiptap/toolbar.ts b/packages/effects/plugins/src/tiptap/toolbar.ts index ba85ba070..c4aa2f439 100644 --- a/packages/effects/plugins/src/tiptap/toolbar.ts +++ b/packages/effects/plugins/src/tiptap/toolbar.ts @@ -1,6 +1,10 @@ import type { Editor } from '@tiptap/vue-3'; -import type { ImageUploadOptions, ToolbarAction, ToolbarMenuItem } from './types'; +import type { + ImageUploadOptions, + ToolbarAction, + ToolbarMenuItem, +} from './types'; import { AlignCenter, diff --git a/packages/effects/plugins/src/tiptap/types.ts b/packages/effects/plugins/src/tiptap/types.ts index a374ba0a9..3546ab2e4 100644 --- a/packages/effects/plugins/src/tiptap/types.ts +++ b/packages/effects/plugins/src/tiptap/types.ts @@ -11,7 +11,10 @@ export interface ImageUploadOptions { /** 上传失败回调,未提供时使用 alert 弹窗提示 */ onUploadError?: (error: unknown) => void; /** 上传函数,返回图片 URL,可选 onProgress 回调报告上传进度 */ - upload: (file: File, onProgress?: (percent: number) => void) => Promise; + upload: ( + file: File, + onProgress?: (percent: number) => void, + ) => Promise; } export interface TipTapProps { diff --git a/playground/src/views/examples/tiptap/index.vue b/playground/src/views/examples/tiptap/index.vue index b8300cc52..4ff518479 100644 --- a/playground/src/views/examples/tiptap/index.vue +++ b/playground/src/views/examples/tiptap/index.vue @@ -1,12 +1,10 @@