did you register the component correctly? For recursive components, make sure to provide the "name"

在引入该组件时,报了个这样的警告,组件死活引入不到,什么原因呢?

<template>
  <div id="app">
    我是APP.vue组件----{{msg}}
    <hr/>
    <Father/>
  </div>
</template>

<script>
import Father from './components/Father.vue'
// import Vue from 'vue'
// Vue.component('Father',Father)
export default {
 name:'app',
 data() {
   return {
     msg: 'hellow-word'
   }
 },
 components:{//局部注册组件..
   Father
 }
}
</script>

经过仔细对比代码,发现我用的component,应该是components,怪自己不仔细了!

 

posted @ 2021-05-27 21:07  野人也有爱  阅读(1106)  评论(0编辑  收藏  举报