2
我有多個骨幹的看法,使一個屏幕,現在我這樣做是這樣的:正確的方式將多個骨幹視圖添加到父視圖
render : function() {
this.$el.html(this.template());
this.view2 = new View2();
this.view2.render();
this.$el.append(this.view2.$el);
... more views added here as necessary
}
這是處理多個視圖正確的方法或有沒有更好的方法來將視圖附加到當前視圖?
我希望能夠destory並重新創建與父視圖中刪除/添加相關的HTML得到一個視圖,而不必做手工。
的可能重複【如何呈現和Backbone.js的追加子視圖(http://stackoverflow.com/questions/9271507/how-to-render-and-append-sub-views-在骨幹-JS) – Puigcerber