Kaynağa Gözat

默认选中第一个

丸子 5 ay önce
ebeveyn
işleme
9aa3f68a04
1 değiştirilmiş dosya ile 3 ekleme ve 3 silme
  1. 3 3
      src/views/programming/ProgrammingList.vue

+ 3 - 3
src/views/programming/ProgrammingList.vue

@@ -94,7 +94,7 @@ const goBackIndex = () => {
 const specificCourses = reactive([])
 
 // 当前激活的按钮索引
-const activeButton = ref(-1)
+const activeButton = ref(0)
 
 // 在获取到categoryId后再调用TopicList接口
 const fetchTopicList = () => {
@@ -117,8 +117,8 @@ const fetchTopicList = () => {
         specificCourses.forEach((_, index) => {
           circleButtons.push({ text: String(index + 1) });
         });
-        // 重置激活按钮索引,但不默认选中第一项
-        activeButton.value = -1;
+        // 重置激活按钮索引,默认选中第一项
+        activeButton.value = 0;
       }
     })
   }