我有一個基本的奧裏利亞組件,它看起來像當我在它的名稱中使用破折號,它不起作用。奧裏利亞破折號在組件名稱不起作用
它工作時,我有這樣的:當是這樣
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