Collections 多个侦听器上的主干集合

Collections 多个侦听器上的主干集合,collections,backbone.js,listener,Collections,Backbone.js,Listener,我在视图的initialize中有多个侦听器,如下所示: this.collection.on('reset', this.render); this.collection.on('add', this.render); this.collection.on('change', this.render); 我很好奇是否有一种方法可以将它们结合起来,因为它们都会触发渲染也许你可以试试 this.collection.on("reset add change", this.render);

我在视图的
initialize
中有多个侦听器,如下所示:

this.collection.on('reset', this.render);

this.collection.on('add', this.render);

this.collection.on('change', this.render);
我很好奇是否有一种方法可以将它们结合起来,因为它们都会触发
渲染

也许你可以试试

this.collection.on("reset add change", this.render);
看。它的工作方式与此处显示的相同,但不确定是否将其与默认收集事件绑定。

可能是您可以尝试的

this.collection.on("reset add change", this.render);
看。它的工作方式与此处显示的相同,但不确定是否将其与默认集合事件绑定