Javascript 自定义组件/模板未显示
在玩了一段时间Aurelia之后,我正在尝试创建一个自定义组件/模板。然而,使用下面的最小代码,我似乎仍然无法显示Javascript 自定义组件/模板未显示,javascript,aurelia,Javascript,Aurelia,在玩了一段时间Aurelia之后,我正在尝试创建一个自定义组件/模板。然而,使用下面的最小代码,我似乎仍然无法显示testcomponent.html中的消息。我在HTMLDOM中看到了,但是没有看到消息test。我做错了什么 integrationcomponent.html <template> <require from="./forms/testcomponent"></require> <h1>first page<
testcomponent.html
中的消息。我在HTMLDOM中看到了
,但是没有看到消息test
。我做错了什么
integrationcomponent.html
<template>
<require from="./forms/testcomponent"></require>
<h1>first page</h1>
<testcomponent></testcomponent>
</template>
<template>
<p>test</p>
</template>
testcomponent.html
<template>
<require from="./forms/testcomponent"></require>
<h1>first page</h1>
<testcomponent></testcomponent>
</template>
<template>
<p>test</p>
</template>
试验
类名为TestComponent;这告诉Aurelia查找test-component.html和test-component.js
我认为您也可以将该类重命名为“Testcomponent”
Aurelia是约定优于配置,因此您需要了解约定
控制台中没有任何错误消息吗?控制台中没有错误消息,但在我重命名编辑后工作很奇怪,因为我还有其他情况,上面用camelCase命名工作正常,html文件名之间也没有
-