首页 > 编程 > JavaScript > 正文

微信小程序methods中定义的方法互相调用的实例代码

2019-11-19 13:19:40
字体:
来源:转载
供稿:网友

当调用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中定义的方法互相调用的实例代码,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对武林网网站的支持!

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表