小编use*_*940的帖子

Vue.js 如何设置滚动位置回到顶部?

因此,每当我单击“编辑”按钮时,都会弹出一个带有滚动条的对话框,我可以在其中填写信息。但是当我单击“取消”或“保存”然后单击相同的“编辑”按钮时,对话框会在相同的滚动位置弹出。我想,每次当我点击“编辑”并打开对话框时,总是在对话框页面的顶部,而不是我最后离开的地方。

<template>
    <!-- <div class="text-xs-center" v-if="storeState.admin" lazy> --> 
      <v-dialog 
      transition="dialog-bottom-transition" 
      scrollable 
      fullscreen 
      v-model="sheet" 
      v-if="storeState.admin"  
      lazy 
      persistent 
    > 
      <template v-slot:activator="{on}"> 
        <v-btn flat color="green" dark icon v-on="on"> 
            <v-icon>edit</v-icon>
        </v-btn>
      </template>
        <div background-color="transparent" style="margin: auto auto 0 auto"> 
          <v-card px-5 max-width="800px"> 
            <v-card-title>
                ADD SCHOLARSHIP
            </v-card-title>

        <v-form v-model="addDisabled" validation ref="editForm">
            <v-container>
            <v-layout wrap>
                <v-flex
                xs12
                md4
                >
                <v-text-field
                    v-model="scholarship.title"
                    label="Scholarship name"
                    :counter="maxLength"
                    :rules="[maxLength_rules.max, minLength_rules.min]"
                    required
                ></v-text-field>
                </v-flex>

                <v-flex xs12 md4>
                <v-text-field
                    v-model="scholarship.faculty"
                    label="Faculty"
                    :counter="maxLength"
                    :rules="[maxLength_rules.max, minLength_rules.min]"
                    required
                ></v-text-field>
                </v-flex>

                <v-flex xs12 md4>
                <v-text-field
                    v-model="scholarship.dollarAmount" …
Run Code Online (Sandbox Code Playgroud)

scrollview vue.js

2
推荐指数
1
解决办法
4724
查看次数

标签 统计

scrollview ×1

vue.js ×1