Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我看来,我有多个听众initialize,看起来像这样:
initialize
this.collection.on('reset', this.render); this.collection.on('add', this.render); this.collection.on('change', this.render);
我很好奇是否有办法将它们全部结合起来,因为它们都会发射render
render
可能你可以试试
this.collection.on("reset add change", this.render);
看看这个。它可以在此处显示,但不确定是否将其与默认集合事件绑定。