我有以下 BackboneJS 视图,它有一个模型:
view = Backbone.View.extend({
events: {
// This will fire btnClicked() when the button is clicked
"click .btn": "btnClicked",
// Will this fire when the "data" property of my model changes?
"change:data": "render"
},
btnClicked: function() {},
render: function() {}
});
知道是否可以使用此快捷方式吗?
如果不是,则扩展形式为:
this.model.bind("change:data", render);