Skip to content

Commit 37eaada

Browse files
committed
Update index.jsx
修复右键菜单配置动态修改,右键菜单功能失效的问题
1 parent e044698 commit 37eaada

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/ve-contextmenu/src/index.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,14 @@ export default {
158158
options: {
159159
handler: function (val) {
160160
if (Array.isArray(val) && val.length > 0) {
161+
/*
162+
如果配置项修改,则重新销毁并创建
163+
*/
164+
this.removeOrEmptyPanels(true);
161165
this.rootContextmenuId = this.getRandomIdWithPrefix();
162166
this.createInternalOptions();
163167
this.createPanelOptions({ options: this.internalOptions });
168+
this.resetContextmenu();
164169
this.addRootContextmenuPanelToBody();
165170
}
166171
},

0 commit comments

Comments
 (0)