我有一个带有两个子视图的主视图(使用 DurandalJS 组合)。现在,主视图的 viewAttached 事件提前触发,而我的子视图仍在处理 ajax 请求。理想情况下,主视图只会将视图附加到 DOM 并在所有组合子视图完成激活后运行转换。
<h1>Hello World</h1>
<div data-bind="compose: { model: 'viewmodels/subview1', activate: true }">Loading...</div>
<div data-bind="compose: { model: 'viewmodels/subview2', activate: true }">Loading...</div>