Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #560 toolbar合并hooks时,重名的处理方式改为保留toolbar原有hook #568

Merged
merged 1 commit into from
Sep 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading