소스 검색

点击上下节侧边栏样式跟着变化

丸子 9 달 전
부모
커밋
d6a9395c2a
2개의 변경된 파일11개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      .env
  2. 10 1
      src/views/AIDevelop.vue

+ 1 - 1
.env

@@ -2,7 +2,7 @@
 VITE_APP_TITLE=AI课程网
 
 # 请求路径
-#VITE_BASE_URL='http://59.110.91.129/admin-api'
+# VITE_BASE_URL='http://59.110.91.129/admin-api'
 VITE_BASE_URL='http://192.168.110.8:8080/admin-api'
 
 # 默认账户密码

+ 10 - 1
src/views/AIDevelop.vue

@@ -23,7 +23,7 @@
                 课程小节
               </h3>
               <el-menu
-                default-active="1-1"
+                :default-active="activeMenuIndex"
                 @open="handleOpen"
                 @close="handleClose"
                 @select="handleSelect"
@@ -278,6 +278,8 @@ const toggleDrawer = () => {
   drawerVisible.value = !drawerVisible.value
 }
 
+const activeMenuIndex = ref('1-1')
+
 // 返回上一页
 const goBack = () => {
   router.go(-1)
@@ -448,11 +450,14 @@ const playNextVideo = () => {
         once: true
       })
     }
+      // 更新侧边栏选中状态,这里需要根据实际逻辑调整index值
+  activeMenuIndex.value = nextIndex
   }
   // 重置
   pausedIndices = ref([])
   userMessage = ref('')
   messageHistory = ref([])
+  
 }
 
 // 切换视频
@@ -471,7 +476,10 @@ const playPreviousVideo = () => {
         once: true
       })
     }
+    // 更新侧边栏选中状态,这里需要根据实际逻辑调整index值
+  activeMenuIndex.value = nextIndex 
   }
+  
 }
 
 // 尝试播放视频,处理浏览器自动播放限制
@@ -556,6 +564,7 @@ const currentQuestion = ref({ title: '', options: [] })
 // 用户选择的选项
 const selectedOption = ref(null)
 
+
 // AI对话弹出框显示状态
 let showAIDialog = ref(false)
 // 用户输入的消息