當調用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中定義的方法互相調用的實例代碼,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對武林網網站的支持!
新聞熱點
疑難解答