在组件的任何一个生命周期输出this.methods都为undefined,为什么?请问组件的methods对象什么时候初始化?
// components/c1/c1.js
Component({
properties: {
},
data: {
},
methods: {
hello: function(){
}
},
ready: function(){
console.log(this.methods)
},
attached: function(){
console.log(this.methods)
}
})
输出都是: undefined
好好看看文档 https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/lifetimes.html