Skip to content

Instantly share code, notes, and snippets.

@goofmint

goofmint/index.js

Created Jul 9, 2017
Embed
What would you like to do?
var HelloClass = h5.cls.RootClass.extend(function (super_) {
var id = 0;
return {
// クラス名(完全修飾名)
name: 'HelloClass',
// クラスのフィールド定義
field: {
_id: null
},
accessor: {
id: {
get: function() {
return id;
},
set: function(i) {
id = i;
}
}
},
// クラスのメソッド定義
method: {
constructor: function (params) {
// 親クラスのコンストラクタ呼び出し
super_.constructor.call(this);
id++;
}
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment