问题模块 |
---|
API和组件 |
我在Page内部定义了一个test方法,然后在Onload方法里使用
setInterval(that.test(), 10000);
小程序就报错了
错误信息:
setInterval expects a function as first argument but got undefined.;at pages/index/index page lifeCycleMethod onLoad function
TypeError: setInterval expects a function as first argument but got undefined.
网友回复
Kinder:
你把this.test()的括号去掉就可以了