3
내 앱에서 Marionette
의 내선 번호는 Backbone
입니다. 내가 같이 첫 번째 오류로 점점 오전 :백본 마리오네트 - 레이아웃 호출시 오류가 발생합니다.
Uncaught TypeError: Cannot read property 'extend' of undefined
그리고 요소를 래퍼 바닥 글 내 헤더 및 내용을 추가하려합니다 ...이 스크립트를 사용하여 :
을하지만 전혀 작동하지 않습니다 .. .
이 작업을 수행하는 올바른 방법은 무엇입니까?
템플릿 :
<div id="wrapper"></div>
<script id="layout-template" type="text/template">
<section>
<navigation id="menu">ABC</navigation>
<article id="content">123</article>
</section>
</script>
스크립트
여기AppLayout = Backbone.Marionette.Layout.extend({
template: "#layout-template",
regions: {
menu: "#menu",
content: "#content"
}
});
var layout = new AppLayout();
$('#wrapper').html(layout.render().el);
모든 사람이 나를하시기 바랍니다 래퍼 내 모든 요소를 렌더링하는 데 도움이 무엇입니까? 카일 니드 햄 말했듯이
이AppLayout = Backbone.Marionette.LayoutView.extend({
template: "#layout-template",
regions: {
menu: "#menu",
content: "#content"
}
});
, LayoutView
에 대한 Layout
을 변경
마리오네뜨는'Layout'을'2.0' 릴리스에서'LayoutView'로 변경 했으므로'Backbone.Marionette.LayoutView.extend'이어야합니다. –