Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在区域 App.mainRegion 中呈现两个视图。第一个视图属于模块 A,第二个视图属于模块 B。
最好的方法是什么?一些模块 C,应该呈现布局。然后模块 C 使用请求/响应接收 view1 和 view2 并将视图附加到布局?
谢谢!
Marionette 的强项之一是深度嵌套的视图,这可能就是你在这里得到的。我认为最好的方法是传递一个木偶布局,app.mainRegion.show()其中包含两个区域,然后分别显示视图 A 和视图 B。
app.mainRegion.show()
一个简短的说明.show()是您只想在.onShow()方法中调用它(而不是initialize()否则onRender()您将设置自己以便稍后访问 DOM 元素悲伤(请参阅我的帖子)
.show()
.onShow()
initialize()
onRender()