我有一个小表单来添加一个项目,以及一个列出所有项目的集合视图。但是,我没有看到在哪里/如何为新项目调用渲染:
表单视图:
类 FastTodo.Views.AddTodoItem 扩展 Backbone.View
模板:JST['todo_items/add_item']
埃尔:'#main'
事件:
“提交”:“添加项目”
添加项目:(事件)->
event.preventDefault()
@collection.create 任务:$('#task').val()
渲染:->
$(@el).html @template()
初始化:->
@collection = new FastTodo.Collections.TodoItems()
@使成为()
收藏视图:
类 FastTodo.Views.TodoItemsIndex 扩展 Backbone.View
模板:JST['todo_items/index']
渲染:->
console.log("渲染")
renderOne:(项目)->
控制台日志(项目)
初始化:->
@collection = new FastTodo.Collections.TodoItems()
@collection.bind '重置',=>
@使成为()
@collection.on 'add', (item) =>
console.log('添加')
@renderOne(项目)
@collection.fetch()
我希望控制台中的输出显示一个新项目。但是,我看到:

如何在集合中呈现新项目?(或者显示 renderOne 被触发了?)