Skip to content

Commit

Permalink
fix: group-menu 考虑 excludeKeys
Browse files Browse the repository at this point in the history
  • Loading branch information
wangfupeng1988 committed Nov 29, 2021
1 parent 31113f9 commit ecc29f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/core/src/menus/bar/Toolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/examples/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
// index: 5,
// keys: ['insertImage', 'insertVideo']
// },
// excludeKeys: ['headerSelect', 'underline', 'group-more-style', 'fontFamily']
// excludeKeys: ['headerSelect', 'underline', 'clearStyle', 'fontFamily', 'group-image']
},
})
</script>
Expand Down

0 comments on commit ecc29f3

Please sign in to comment.