报错信息:
报错信息:
Unknown custom element: <addsync> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
翻译:未知的自定义元素:<addsync>-您是否正确注册了组件?对于递归组件,请确保提供“name”选项。
这个可能是因为你的组件名字写错了,就像我下面这个错误示例一样
<template>
<div>
<addsync></addsync>
</div>
</template>
<script>
import AddAsync from "./components/AddAsync.vue";
export default {
data() {
return {
}
},
components: {
addSync: AddAsync
},
}
</script>
在这个示例中,我导入了AddAsync,vue这个组件,用AddAsync这个变量来接收,并且,我在组件中写了addSync来对应这个AddAsync变量,也就是说 实际上我在使用这个组件的时候只需要使用addSync作为标签名就可以了,但是,请看这两个地方
这两个地方的单词都没对上,那个S不小心写成了小写,导致在运行代码时并没有找到这个addsync,因此就报错了,改正过来就可以了。