有没有可能让Aurelia在没有封装组件节点的情况下呈现一个自定义元素?或者用它的内容替换自定义元素节点?
示例:
app.html
<template>
<require from = "./components/custom-component.html"></require>
<custom-component></custom-component>
</template>app.ts
export class App {
}custom-component.html
<template>
<p>This is some text from dynamic component...</p>
</template>结果

基于此示例:是否可以使用aurelia将组件中的<p>元素呈现为<body>的直接子元素,这样就不会有custom-component-node?
发布于 2017-08-22 18:09:35
在组件上使用containerless属性。
示例:https://gist.run/?id=8e57000c7b8423dc0246a7006d90ba79
您还可以使用containerless()装饰器来装饰您的自定义组件。请参阅:http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/cheat-sheet/9
https://stackoverflow.com/questions/45814281
复制相似问题