收藏
回答

onUnload 时,无法获取页面节点数据

框架类型 操作系统 工具版本
小程序 Windows v1.02.1801081


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();

}


最后一次编辑于  2018-02-08
回答关注问题邀请回答
收藏

1 个回答

  • 工号9527
    工号9527
    2018-02-08

    页面都销毁了啊

    2018-02-08
    有用
    回复
登录 后发表内容