我正在使用 Backbone.Marionette,需要呈现员工及其各自部门的视图。我希望它看起来像这样:
Department 1
***
Employee1
Employee2
Employee3
Department 2
***
Employee4
Employee5
Employee6
Employee7
Employee8
Department 3
***
Employee9
Employee10
我的收藏看起来像这样:
Employee1 / Department1
Employee2 / Department1
Employee3 / Department1
Employee4 / Department2
Employee5 / Department2
etc.
作为department
我需要渲染department
标题的更改。
我将使用哪种视图类型组合。Collection view
, Composite view
. 我需要将逻辑放在视图/模板中吗?