我有以下模型:
var User = Backbone.Model.extend({
defaults: {
status: this.constructor.status.OFFLINE,
},
},
{
status: {
OFFLINE: 0,
ONLINE: 1,
BUSY: 2,
AWAY: 3,
},
}
);
我也试过:
status: User.status.OFFLINE
但我不断收到此错误:
TypeError: 'undefined' is not an object (evaluating 'this.constructor.status.OFFLINE')
或这个:
TypeError: 'undefined' is not an object (evaluating 'User.status')
有什么帮助吗?谢谢