我的布局没有显示我的项目视图。
这是我的标记:
<div id="wrapper">
<div id="header">header div</div>
<div id="main">main div</div>
</div>
这是我的javascript:
var EventView = Backbone.Marionette.ItemView.extend({
template: Handlebars.compile("Name of event: {{name}}"),
model: new Backbone.Model({
name: "Game"
}),
});
var AppLayout = Backbone.Marionette.Layout.extend({
template: '#wrapper',
regions: {
header: '#header',
main: '#main'
}
});
var layout = new AppLayout();
layout.render();
var event1 = new EventView();
layout.main.show(event1);
我想要的只是
<div id="main">Name of event: Game</div>