在 Backbone 视图中的每个方法的末尾是否需要“return this”?
render: function() {
this.editElem();
// I realize it wouldn't be necessary here, but...
},
renderElem: function() {
this.$el.addClass('foobar');
return this // is this one necessary?
},
编辑 这个例子怎么样?
render: function() {
this.editElem();
},
renderElem: function() {
this.$el.addClass('foobar');
return this;
},