将 aurelia-app 属性移动到另一个 html 元素?

Move aurelia-app attribute to another html element?

aurelia 的所有示例似乎都将 aurelia-app 指令放在 <body> 元素上。

能否将 aurelia-app 放在其他 html 元素上,而不是放在 <body> 上?如果是这样,是否有理由避免这样做?

official documentation 状态:

Simply place this on an HTML element and Aurelia's bootstrapper will load an app.js and app.html, databind them together and inject them into the DOM element on which you placed that attribute.

我测试了这个:

<body>
  <div aurelia-app="app-window">
  </div>
  ...
</body>

它确实在那时注入了您的 aurelia 应用程序:

我不知道这是否是个好主意,即这样做是否会出现无法预料的问题。