miniprogram-simulate icon indicating copy to clipboard operation
miniprogram-simulate copied to clipboard

TypeError: comp.triggerPageLifeTime is not a function

Open Joey-dev-58 opened this issue 3 years ago • 3 comments

在组件中有以下代码: pageLifetimes: { hide() { this.setData({ showDialog: false }); }, }, 在unit test中使用 comp.triggerPageLifeTime('hide');运行test后,得到TypeError: comp.triggerPageLifesTime is not a function的报错,unit test未通过。

Joey-dev-58 avatar Oct 26 '21 06:10 Joey-dev-58

你的报错信息,是用了 triggerPageLifesTime ?

正确接口名是:triggerPageLifeTime

JuneAndGreen avatar Oct 26 '21 07:10 JuneAndGreen

你的报错信息,是用了 triggerPageLifesTime ?

正确接口名是:triggerPageLifeTime

Sorry, 我写错了title,其实我代码里面用的是triggerPageLifeTime。

Joey-dev-58 avatar Oct 26 '21 07:10 Joey-dev-58

我试了下本地用例是正常的,方便给一下可以复现问题的简单 demo 么?

JuneAndGreen avatar Oct 26 '21 12:10 JuneAndGreen