onUnload 多页返回

发布于 8 年前作者 yan1212835 次浏览最后编辑 8 年前来自 ask

 onUnload: function() {
    // 页面关闭
    console.log(‘pages = getCurrentPages()’);
    var pages = getCurrentPages();
    wx.navigateBack({
      delta: pages.length,
    })
  },

如果有很多页的情况下,为什么这样半闭会显示出 中间 的那些页,再返回到首页,一页页的显示再关闭?

有什么办法处理吗?

1 回复
whou
whou1 楼6 年前

麻烦提供出现问题的机型和微信版本,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html