fix(editor): 组件树多选后右键点击不会变回单选

This commit is contained in:
roymondchen 2023-10-24 15:41:54 +08:00
parent 5e7a0a0c53
commit af72d819fe

View File

@ -145,8 +145,10 @@ const nodeClickHandler = () => {
const contextmenuHandler = (event: MouseEvent) => {
event.preventDefault();
nodeClickHandler();
const nodes = editorService?.get('nodes') || [];
if (nodes.length < 2 || !nodes.includes(props.data)) {
nodeClickHandler();
}
emit('node-contextmenu', event, props.data);
};