【发布时间】:2011-02-25 22:15:22
【问题描述】:
这就是我用实例变量和实例方法定义一个简单类的方式。
ExampleClass = SC.Object.extend({
foo:undefined,
bar: function() {
this.foo = "Hello world";
console.log( this.foo );
}
}
// test
var testInstance = ExampleClass.create();
testInstance.bar(); // outputs 'Hello world'
谁能帮助我提供类变量(或类似行为)和类方法的类似示例?
谢谢
【问题讨论】:
标签: sproutcore