Scroll 执行 destory 方法的时候内存溢出了
来源:2-12 v-loading 自定义指令的优化
weibo_侠肝义胆香鸡腿_0
2021-06-11
import BScroll from '@better-scroll/core';
import ObserveDOM from '@better-scroll/observe-dom';
import { onMounted, onUnmounted, ref } from 'vue';
BScroll.use(ObserveDOM);
export default function useScroll(wrapperRef, options) {
const scroll = ref(null);
onMounted(() => {
scroll.value = new BScroll(wrapperRef.value, {
observeDOM: true,
...options,
});
});
onUnmounted(() => {
scroll.value.destory();
});
}```
写回答
1回答
-
ustbhuangyi
2021-06-12
有什么报错信息吗?
022021-06-12
相似问题