我有一個帶有文本的 div,在我提交該文本后,我從服務(wù)器獲取新數(shù)據(jù)。如果我在第一個文本的底部,我從服務(wù)器獲取的第二個文本也在底部,我想在獲取數(shù)據(jù)后移動到文本的頂部。<b-row class="question-top mb-3" > <b-col xl="12" md="12" sm="12" xs="12"> <div class="question-editor"> <ckeditor :editor="editor" v-model="free_text" :disabled="editorDisabled"></ckeditor> </div> </b-col></b-row>//style.question-editor{ overflow-y: auto; //so here I have the scroll}methods(){ getData() { axios...CODE.. //and here I try to move to the top of that div var topElement = document.querySelector('.question-editor'); scrollTo(topElement, 0, 100); }}
div上的ScrollTop,Vuejs
瀟湘沐
2022-07-21 09:48:20