我有一个基本的奥里利亚组件,它看起来像当我在它的名称中使用破折号,它不起作用。奥里利亚破折号在组件名称不起作用
它工作时,我有这样的:当是这样
import {inject, customElement, bindable} from 'aurelia-framework';
@customElement('helloworld')
@inject(Element)
export class HelloWorldCustomElement {
constructor(element) {
console.log ('here')
}
}
<helloworld></helloworld>
但事实并非如此:
import {inject, customElement, bindable} from 'aurelia-framework';
@customElement('hello-world')
@inject(Element)
export class HelloWorldCustomElement {
constructor(element) {
console.log ('here')
}
}
<hello-world></hello-world>
根据Aurelia文档,它应该可以同时工作:https://github.com/aurelia/templating/blob/master/doc/article/en-US/templating-custom-elements.md
你确定你没有在你的一个应用另一个'HELLO-world'成分,特性? –
这似乎是这种情况。我正在导入一个与导致冲突的名称相同的HTML文件:' ' –
st3fan