开发者

javascript class props

开发者 https://www.devze.com 2023-03-13 13:04 出处:网络
I have a class defined like thi开发者_开发知识库s (scheme) : myClass = BaseClass.extend({ method1 : function(){ ...},

I have a class defined like thi开发者_开发知识库s (scheme) :

myClass = BaseClass.extend({
    method1 : function(){ ...},
    method2 : function(){ ...}
});

How can I call method2 from method1? something like:

myClass = BaseClass.extend({
    method1 : function(){ method2(); },
    method2 : function(){ ...}
});


you need scope:

this.method2();
0

精彩评论

暂无评论...
验证码 换一张
取 消