Преглед изворни кода

fix(editor): 修复子页面切换显示异常问题,添加调试日志

1. 调整ThumbnailChildPage的点击处理逻辑,先隐藏子页面再延迟500ms恢复显示,修复切换卡顿问题
2. 在工具保存/放弃函数中添加对应调试日志方便排查问题
3. 调用setChildPageState时传入空工具数组初始化状态
lsc пре 3 дана
родитељ
комит
8126ed9945

+ 4 - 0
src/views/Editor/Canvas/ChildPageDisplay.vue

@@ -235,17 +235,21 @@ const changeSlideIndex = (index: number) => {
 }
 // 保留工具
 const saveTool = (url: string, type: any, index: number) => {
+  console.log('保留工具')
+  
   createSlide()
   createFrameElement(url, type)
   changeSlideIndex(childPageIndex.value)
   toolsArray[index].isSet = true
   setTool()
+  console.log('保留工具', toolsArray)
 }
 
 // 放弃工具
 const discardTool = (index: number) => {
   toolsArray[index].isSet = true
   setTool()
+  console.log('放弃工具', toolsArray)
 }
 
 // 保留所有工具

+ 5 - 1
src/views/Editor/Thumbnails/ThumbnailChildPage.vue

@@ -37,8 +37,12 @@ const changeSlideIndex = (index: number) => {
 }
 
 const handleClick = () => {
+  console.log(props.slideIndex)
   changeSlideIndex(props.slideIndex || 0)
-  setChildPageState(true, props.toolsArray || [], props.slideIndex || 0)
+  setChildPageState(false, [], props.slideIndex || 0)
+  setTimeout(() => {
+    setChildPageState(true, props.toolsArray || [], props.slideIndex || 0)
+  }, 500)
 }
 
 // 计算待处理任务数量