画布文字取消编辑关闭文字面板

This commit is contained in:
李志鹏
2025-11-13 16:07:32 +08:00
parent f6178d8cb2
commit 0478e95f4f
2 changed files with 15 additions and 8 deletions

View File

@@ -620,12 +620,19 @@ export default {
// 监听显示文本编辑面板事件
document.addEventListener("showTextEditor", showEditor);
document.addEventListener("hideTextEditor", close);
if(props.canvas) {
// props.canvas.on("text:editing:entered", showEditor);
props.canvas.on("text:editing:exited", close);
}
});
onUnmounted(() => {
document.removeEventListener("showTextEditor", showEditor);
document.removeEventListener("hideTextEditor", close);
if(props.canvas) {
// props.canvas.off("text:editing:entered", showEditor);
props.canvas.off("text:editing:exited", close);
}
});
// 返回所有需要在模板中使用的数据和方法