难道只有我遇到Tab切换后无法滚动的问题?
来源:3-2 IndexList 组件基础滚动功能实现
Star_星
2021-05-18
/*
"@better-scroll/core": "^2.2.1",
"@better-scroll/observe-dom": "^2.2.1"
*/
import BScroll from '@better-scroll/core'
import ObserveDOM from '@better-scroll/observe-dom'
import { ref, onMounted, onUnmounted } from 'vue'
BScroll.use(ObserveDOM)
export function useScroll(wrapperRef, options, emit) {
const scroll = ref(null)
onMounted(() => {
scroll.value = new BScroll(wrapperRef.value, {
observerDOM: true,
...options
})
})
onUnmounted(() => {
scroll.value.destroy()
})
return scroll
}
写回答
1回答
-
属性 Key 是
observeDOM
而不是
observerDOM
012021-05-18
相似问题