微信小程序methods中定义的方法互相调用的实例代码
当调用test2时: methods = { test(age){ console.log('test', age); },当调用test2时:
methods = {
test(age){
console.log('test', age);
},
test2(){
console.log(this.methods);
this.methods.test('222');
console.log('test2')
}
};运行结果:
{test: f, test2: f}
test 222
test2总结
以上所述是小编给大家介绍的微信小程序methods中定义的方法互相调用的实例代码,希望对大家有所帮助。
页:
[1]