印花图层禁用画笔等工具

This commit is contained in:
李志鹏
2026-01-08 16:37:35 +08:00
parent 5bbc71654a
commit d863376b41
3 changed files with 39 additions and 20 deletions

View File

@@ -153,7 +153,7 @@ const canvasManagerLoaded = ref(false); // 画布是否加载完成
// 红绿图模式状态
const isRedGreenMode = ref(false);
const isShowLayerPanel = ref(true); // 是否显示图层面板
const isShowLayerPanel = ref(false); // 是否显示图层面板
provide("isShowLayerPanel", isShowLayerPanel); // 提供红绿图模式状态给子组件
@@ -546,13 +546,9 @@ watchEffect(() => {
});
onBeforeUnmount(async () => {
// if (import.meta.hot) {
// // 热更新
// console.log("onBeforeUnmount 开发环境热更新不卸载组件...");
// return; // 开发环境下不卸载组件
// }
const extraInfo = await canvasManager.exportExtraInfo();
emit("before-unmount-export-extra-info", extraInfo);
observer.unobserve(canvasContainerRef.value);
// const extraInfo = await canvasManager.exportExtraInfo();
// emit("before-unmount-export-extra-info", extraInfo);
console.log("onBeforeUnmount 组件卸载,清理资源...");
canvasManager?.dispose?.();
@@ -576,7 +572,6 @@ onBeforeUnmount(async () => {
// 移除window resize事件监听
// window.removeEventListener("resize", handleWindowResize);
observer.unobserve(canvasContainerRef.value);
});
// 窗口大小变化处理函数
@@ -584,6 +579,7 @@ function handleWindowResize() {
console.log(132);
// 使用requestAnimationFrame来防止频繁更新
setTimeout(() => {
if(!canvasManager) return;
// 更新画布大小并自动居中所有元素
updateCanvasSize();