Просмотр исходного кода

教材管理预览页默认显示第一个课件

dsy 6 дней назад
Родитель
Сommit
825b0a55fa
1 измененных файлов с 4 добавлено и 8 удалено
  1. 4 8
      src/components/CommonPreview.vue

+ 4 - 8
src/components/CommonPreview.vue

@@ -1053,14 +1053,10 @@ export default {
             });
           }
 
-          // 项目预览页面,默认选中第一个节点
-          if (this.type === 'project-preview') {
-            this.node_list.find((item) => {
-              if (item.is_leaf_chapter === 'true') {
-                this.selectChapterNode(item.id, true);
-                return true;
-              }
-            });
+          // 项目预览页面,默认选中第一个课件(叶子节点)
+          if (this.type === 'project_preview') {
+            const firstCourseware = this.node_list.find((item) => item.is_leaf_chapter === 'true');
+            if (firstCourseware) this.selectChapterNode(firstCourseware.id, true);
           }
         }
       });