Ver Fonte

重置滚动条

szw há 1 ano atrás
pai
commit
c16e42beb8
1 ficheiros alterados com 5 adições e 1 exclusões
  1. 5 1
      src/views/register.vue

+ 5 - 1
src/views/register.vue

@@ -10,7 +10,7 @@
           <el-step title="注册套餐"></el-step>
         </el-steps>
       </div>
-      <div class="contentSty">
+      <div class="contentSty" ref="content">
         <!-- 动态组件 -->
         <component
           :is="currentComponent"
@@ -104,9 +104,13 @@ export default {
   methods: {
     next() {
       this.activeStep++;
+      //重置滚动条
+      this.$refs.content.scrollTop = 0;
     },
     previous() {
       this.activeStep--;
+      //重置滚动条
+      this.$refs.content.scrollTop = 0;
     },
     changeComponents(componentName) {
       this.currentComponent = componentName;