Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/475.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/79.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
Javascript 自定义组件/模板未显示_Javascript_Aurelia - Fatal编程技术网

Javascript 自定义组件/模板未显示

Javascript 自定义组件/模板未显示,javascript,aurelia,Javascript,Aurelia,在玩了一段时间Aurelia之后,我正在尝试创建一个自定义组件/模板。然而,使用下面的最小代码,我似乎仍然无法显示testcomponent.html中的消息。我在HTMLDOM中看到了,但是没有看到消息test。我做错了什么 integrationcomponent.html <template> <require from="./forms/testcomponent"></require> <h1>first page<

在玩了一段时间Aurelia之后,我正在尝试创建一个自定义组件/模板。然而,使用下面的最小代码,我似乎仍然无法显示
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文件名之间也没有
-