项目中遇到,页面跳转之后,新打开的页面的滚动条没有回到顶部
mounted(){
this.$nextTick(() => {
let viewEl = document.querySelector('.demo');
if (viewEl.scrollTop>0) {
viewEl.scrollTop = 0
}
});
},
再加上平滑过渡
/deep/.ant-modal-body{
scroll-behavior: smooth;
}