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

当调用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

猜你喜欢

转载自blog.csdn.net/qq_35790269/article/details/81478467