Browse Source

添加了下一题后回到顶部逻辑

Mask96 5 years ago
parent
commit
ded9f411c8
1 changed files with 9 additions and 0 deletions
  1. 9 0
      src/components/WebQn.vue

+ 9 - 0
src/components/WebQn.vue

@@ -300,6 +300,13 @@ export default {
       return opts;
     }
   },
+  watch: {
+    questionHEAD() {
+      //换题后返回页面顶部
+      document.documentElement.scrollTop = 0;
+    },
+    
+  },
   methods: {
     getParam: function(name) {
       if (
@@ -433,6 +440,7 @@ export default {
         this.selectedSingle = "";
         this.selectedMultiple = [];
       }
+
       // 根据题目类型,动态展示对应的答题方式
       // ---- 已在页面绑定中体现了
 
@@ -695,4 +703,5 @@ export default {
   margin-top: 40px;
   margin-left: 2%;
 }
+
 </style>