Skip to content

Commit

Permalink
fix: #560 toolbar合并hooks时,重名的处理方式改为保留toolbar原有hook (#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
CainXCain committed Sep 3, 2023
1 parent d1e7d65 commit d69c0ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/toolbars/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export default class Toolbar {
*/
collectMenuInfo(toolbarObj) {
this.toolbarHandlers = Object.assign({}, this.toolbarHandlers, toolbarObj.toolbarHandlers);
this.menus.hooks = Object.assign({}, this.menus.hooks, toolbarObj.menus.hooks);
this.menus.hooks = Object.assign({}, toolbarObj.menus.hooks, this.menus.hooks);
// 只有没设置自定义快捷键的时候才需要收集其他toolbar对象的快捷键配置
if (!this.options.shortcutKey || Object.keys(this.options.shortcutKey).length <= 0) {
this.shortcutKeyMap = Object.assign({}, this.shortcutKeyMap, toolbarObj.shortcutKeyMap);
Expand Down

0 comments on commit d69c0ad

Please sign in to comment.