uni-app scroll-into-view使用注意事项
uni-app scroll-into-view使用注意事项
1: 不能写成死值
<scroll-view :scroll-into-view=“scrollIntoView” scroll-with-animation class=“index-container” scroll-y=“true” @scroll=“handleScroll”>
2: 且要变化, 否则再次触发返回顶部的时候会失效
let scrollIntoView = ref('')
function handleScroll(event) {
scrollIntoView.value = ''
}
function backToTop() {
scrollIntoView.value = "top"
}
1 回复