Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无外部节点的Aurelia自定义元素_Aurelia - Fatal编程技术网

无外部节点的Aurelia自定义元素

无外部节点的Aurelia自定义元素,aurelia,Aurelia,是否可以让Aurelia在没有封装组件节点的情况下渲染自定义元素?或者将自定义元素节点替换为其内容 例如: app.html <template> <require from = "./components/custom-component.html"></require> <custom-component></custom-component> </template> 自定义组件.html <tem

是否可以让Aurelia在没有封装组件节点的情况下渲染自定义元素?或者将自定义元素节点替换为其内容

例如:

app.html

<template>
  <require from = "./components/custom-component.html"></require>
     <custom-component></custom-component>
</template>
自定义组件.html

<template>
    <p>This is some text from dynamic component...</p>
</template>

这是动态组件中的一些文本

结果


基于此示例:使用aurelia是否可以将组件中的
元素呈现为
的直接子元素,这样就不会有
自定义组件
-节点?

在组件上使用
无容器
属性

例如:

您还可以使用
containerless()
decorator装饰自定义组件。
请参阅:

请注意,只有在绝对必要时才应使用
无容器属性/装饰器。它约束一些自定义元素功能。
<template>
    <p>This is some text from dynamic component...</p>
</template>