小程序路由栈报错
发布于 5 年前 作者 mengyang 11248 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)
  • 预期表现
  • 复现路径
  • 提供一个最简复现 Demo

if (getCurrentPages()[0].__displayReporter.showReferpagepath != ‘pages/lesson/detail/index.html’) {

this.onLoad()

}

想判断上级路由是不是’pages/lesson/detail/index.html’,然后线上的右报错“Cannot read property ‘showReferpagepath’ of undefined;at “pages/lesson/index” page lifeCycleMethod onShow function“


找不到__displayReporter这个属性,请问为什么,如果存在兼容性问题,有其他的解决方案吗

1 回复

getCurrentPages()[0][’__displayReporter’].showReferpagepath

看看这样行不

回到顶部