소스 검색

默认选中第一个

丸子 5 달 전
부모
커밋
9aa3f68a04
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  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;
       }
     })
   }