From 50d238a48cf99961498effb3dc0dc815797d4da9 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Thu, 30 May 2024 11:29:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(playground):=20=E8=AE=BE=E7=BD=AE=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E8=A1=A8=E5=8D=95=E7=9A=84label-width?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- playground/src/pages/Editor.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/playground/src/pages/Editor.vue b/playground/src/pages/Editor.vue index 0925b704..76629944 100644 --- a/playground/src/pages/Editor.vue +++ b/playground/src/pages/Editor.vue @@ -55,6 +55,7 @@ import { type MenuBarData, type MenuButton, type MoveableOptions, + propsService, type Services, TMagicEditor, } from '@tmagic/editor'; @@ -125,9 +126,9 @@ const usePasteMenu = (menu?: Ref | undefined>): const initialTop = calcValueByFontsize(stage?.renderer.getDocument(), (rect.top || 0) - (parentRect?.top || 0)) / services.uiService.get('zoom'); - services?.editorService?.paste({ left: initialLeft, top: initialTop }); + services?.editorService?.paste({ left: initialLeft, top: initialTop }, collectorOptions); } else { - services?.editorService?.paste(); + services?.editorService?.paste({}, collectorOptions); services?.codeBlockService?.paste(); services?.dataSourceService?.paste(); } @@ -310,6 +311,10 @@ editorService.usePlugin({ }, }); +propsService.usePlugin({ + beforeFillConfig: (config) => [config, '100px'], +}); + onBeforeUnmount(() => { editorService.removeAllPlugins(); });