我有一个带有文本的 div,在我提交该文本后,我从服务器获取新数据。如果我在第一个文本的底部,我从服务器获取的第二个文本也在底部,我想在获取数据后移动到文本的顶部。
<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);
}
}
莫回无
小唯快跑啊
相关分类