Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created July 9, 2017 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goofmint/cae47f4105a9afd54226fe5a8b926c3c to your computer and use it in GitHub Desktop.
Save goofmint/cae47f4105a9afd54226fe5a8b926c3c to your computer and use it in GitHub Desktop.
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