lex 2 سال پیش
والد
کامیت
ca90dc0641

+ 1 - 1
src/views/unit-test/examination-mode/index.tsx

@@ -121,7 +121,7 @@ export default defineComponent({
           //   document.querySelectorAll('.swipe-item-question')[state.currentIndex]
           const currentItemDom: any = document
             .querySelectorAll('.van-swipe-item')
-            [state.currentIndex].querySelector('.swipe-item-question')
+            [state.currentIndex]?.querySelector('.swipe-item-question')
           const rect = useRect(currentItemDom)
 
           state.swipeHeight = rect.height

+ 1 - 1
src/views/unit-test/practice-mode/index.tsx

@@ -196,7 +196,7 @@ export default defineComponent({
           // console.log(document.querySelectorAll('.van-swipe-item'), state.currentIndex)
           const currentItemDom: any = document
             .querySelectorAll('.van-swipe-item')
-            [state.currentIndex].querySelector('.swipe-item-question')
+            [state.currentIndex]?.querySelector('.swipe-item-question')
           const rect = useRect(currentItemDom)
           state.swipeHeight = rect.height
         }, 100)

+ 1 - 1
src/views/unit-test/unit-detail/index.tsx

@@ -158,7 +158,7 @@ export default defineComponent({
         setTimeout(() => {
           const currentItemDom: any = document
             .querySelectorAll('.van-swipe-item')
-            [state.currentIndex].querySelector('.swipe-item-question')
+            [state.currentIndex]?.querySelector('.swipe-item-question')
           const rect = useRect(currentItemDom)
           console.log('🚀 ~ setTimeout ~ currentItemDom', currentItemDom)
           console.log('🚀 ~ setTimeout ~ rect', rect, state.currentIndex)