有没有办法为木偶区域指定模板?现在我正在使用布局对象来指定模板。
AppLayout = Backbone.Marionette.Layout.extend({
template: tmpl
});
var layout = new AppLayout();
App.main.show(layout);
App.addRegions({
userInfo: "#userInfo",
mainMenu: "#mainMenu",
content: "#content"
});
App.mainMenu.show(new mainMenuView.Views.menu());
App.content.show(new dashboard.Views.main());
为什么当我在布局对象中定义它们时,我无法直接从我的应用对象访问我的区域?
AppLayout = Backbone.Marionette.Layout.extend({
template: tmpl
regions: {
userInfo: "#userInfo",
mainMenu: "#mainMenu",
content: "#content"
}
});
var layout = new AppLayout();
App.main.show(layout);
does not work:
App.mainMenu.show(new mainMenuView.Views.menu());
App.content.show(new dashboard.Views.main());
谢谢