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

来自:网络
时间:2020-05-27
阅读:

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

返回顶部
顶部