1. 点击页面左上角的返回按钮,触发onUnload 时,想要获取页面节点数据,在开发工具中,无法打印res.scrollTop的值。
2. iOS真机“远程调试”,显示onUnload have been invoked,但是没有打印内容.
record_progress:function(){
let that = this;
let q = wx.createSelectorQuery().in(this);
q.selectViewport().scrollOffset(function (res) {
console.log(res.scrollTop);
})exec();
},
onHide:function(){
this.record_progress();
},
onUnload:function(){
this.record_progress();
}
页面都销毁了啊