关于vue未注册组件报错问题

版权声明:小苹果的成长笔记 https://blog.csdn.net/weixin_42416812/article/details/88533818

webpack-internal:///./node_modules/vue/dist/vue.esm.js:629 [Vue warn]: Unknown custom element: <van-tabs> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

found in

---> <Renzheng> at src/components/EditPersonal.vue
       <App> at src/App.vue
         <Root>

解决方案:

在main.js里面注册全局组件

mport Vue from 'vue'

import App from './App'

import router from './router'

import Header from './components/public/Header'

import Footer from './components/public/Footer'

Vue.config.productionTip = false

//全局注册组件

Vue.component("app-header",Header)

Vue.component("app-footer",Footer)

/* eslint-disable no-new */

new Vue({

el: '#app',

router,

components: { App,},

template: '<App/>'

})

https://blog.csdn.net/qq_34089503/article/details/81329405

猜你喜欢

转载自blog.csdn.net/weixin_42416812/article/details/88533818
今日推荐