ソースを参照

调整切换按钮

wangxy 4 週間 前
コミット
7bed24c584
1 ファイル変更8 行追加4 行削除
  1. 8 4
      components/questions/yuedu.vue

+ 8 - 4
components/questions/yuedu.vue

@@ -90,7 +90,7 @@ import cacheManager from '../../utils/cacheManager';
 		immediate: true
 	})
 
-	watch(() => {
+	watch(() => props.showTishixinxi,() => {
 		if (props.showTishixinxi) {
 			if (!cacheManager.get('exam-tishi')) {
 				// 首次考试打开提示信息
@@ -108,16 +108,18 @@ import cacheManager from '../../utils/cacheManager';
 	function onSwitchChange(e) {
 		console.log('eeee', e.detail,data.content[e.detail.current])
 		Emits('yudu-change', data.content[e.detail.current])
+		swiperDotIndex.value = e.detail.current
 	}
 	
 	function handleRight() {
+	
 		if (swiperDotIndex.value > 0) {
-			swiperDotIndex.value = swiperDotIndex.value--;
+			swiperDotIndex.value = swiperDotIndex.value-1;
 		}
 	}
 	
 	function handleLeft() {
-		
+			console.log(333)
 		if (props.showTishixinxi) {
 			// 阅读题提示
 			cacheManager.set('exam-tishi', 1)
@@ -125,7 +127,9 @@ import cacheManager from '../../utils/cacheManager';
 		}
 		
 		if (swiperDotIndex.value < data.content.length-1) {
-			swiperDotIndex.value = swiperDotIndex.value++;
+			swiperDotIndex.value = swiperDotIndex.value+1;
 		}
+		
+		console.log('	swiperDotIndex.value',	swiperDotIndex.value,swiperDotIndex.value < data.content.length-1)
 	}
 </script>