vue3[Vue warn]: Failed to resolve component: XXX If this is a native custom element, make sure to ex

自定义标签存在,但是没有渲染
vue3[Vue warn]: Failed to resolve component: XXX If this is a native custom element, make sure to ex_第1张图片
报错:
vue3[Vue warn]: Failed to resolve component: XXX If this is a native custom element, make sure to ex_第2张图片
原因:
改正前:

<script>
import {milldeLayoutInMain} from "../../components/home/main/milldeLayoutInMain"
export default {
     name: 'MainPage',
     components:{
          milldeLayoutInMain
     }
}
script>

改正后

<script>
import milldeLayoutInMain from "../../components/home/main/milldeLayoutInMain"
export default {
     name: 'MainPage',
     components:{
          milldeLayoutInMain
     }
}
script>

效果:
vue3[Vue warn]: Failed to resolve component: XXX If this is a native custom element, make sure to ex_第3张图片
**

结论:引入单个自定义组件,不加{ }。

**

你可能感兴趣的:(前端,vue,bug)