Commit 898d6d66 by yuzhenWang

优化事件移除

parent d6b92820
...@@ -79,6 +79,16 @@ ...@@ -79,6 +79,16 @@
console.log('组件销毁'); console.log('组件销毁');
this.releaseScroll(); // 确保组件销毁时释放 this.releaseScroll(); // 确保组件销毁时释放
}, },
// 页面隐藏时立即解锁
onHide() {
this.releaseScroll();
},
// 页面卸载时强制清理
onUnload() {
this.releaseScroll();
},
methods: { methods: {
// 锁定滚动 // 锁定滚动
lockScroll() { lockScroll() {
......
...@@ -171,11 +171,6 @@ ...@@ -171,11 +171,6 @@
onShow() { onShow() {
this.init(); this.init();
// #ifdef H5
document.body.removeEventListener('touchmove', function(e) {
e.preventDefault()
}, { passive: false })
// #endif
}, },
onLoad() { onLoad() {
//如果用户在其他的地方快捷登录,没有返回到首页,执行此监听方法 //如果用户在其他的地方快捷登录,没有返回到首页,执行此监听方法
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment