From ecc29f3b24992c8dc0adf006d81b0d4a252683c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=A6=8F=E6=9C=8B?= Date: Mon, 29 Nov 2021 18:16:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20group-menu=20=E8=80=83=E8=99=91=20exclud?= =?UTF-8?q?eKeys?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/menus/bar/Toolbar.ts | 2 ++ packages/editor/examples/menu.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core/src/menus/bar/Toolbar.ts b/packages/core/src/menus/bar/Toolbar.ts index ace95b458..9764c736c 100644 --- a/packages/core/src/menus/bar/Toolbar.ts +++ b/packages/core/src/menus/bar/Toolbar.ts @@ -126,9 +126,11 @@ class Toolbar { const $toolbar = this.$toolbar const group = createBarItemGroup(menu) const { menuKeys = [] } = menu + const { excludeKeys = [] } = this.config // 注册子菜单 menuKeys.forEach(key => { + if (excludeKeys.includes(key)) return this.registerSingleItem( key, group // 将子菜单,添加到 group diff --git a/packages/editor/examples/menu.html b/packages/editor/examples/menu.html index 470380328..ac4d29e72 100644 --- a/packages/editor/examples/menu.html +++ b/packages/editor/examples/menu.html @@ -94,7 +94,7 @@ // index: 5, // keys: ['insertImage', 'insertVideo'] // }, - // excludeKeys: ['headerSelect', 'underline', 'group-more-style', 'fontFamily'] + // excludeKeys: ['headerSelect', 'underline', 'clearStyle', 'fontFamily', 'group-image'] }, })