我在App页面引入了一个vant的ActionSheet组件,运行项目是报错[Vue warn]: Invalid component name: “_Ctor”. Component names should conform to valid custom element name in html5 specification. 像是自己给ActionSheet组件命名了,代码简化如下:
import { Vue, Component } from 'vue-property-decorator'
import { ActionSheet } from 'vant'
@Component({
components: { ActionSheet }
})
export default class App extends Vue {
private render() {
return (<div id="app">
<ActionSheet> /* 静态元素*/</ActionSheet>
</div>)
}
}
控制台信息
[Vue warn]: Invalid component name: “_Ctor”. Component names should conform to valid custom element name in html5 specification.
其他页面也使用过ActionSheet没什么问题,不知道是不是App页面特殊一点。
很明显,我在这里没有命名任何东西_Ctor。为什么名称无效?如何选择有效的名称?
相似问题