Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
321 views
in Technique[技术] by (71.8m points)

[Vue warn]: Unknown custom element: <a-comment>...?

使用ant design pro of vue的时候引入了<a-comment></a-comment>这个组件,但发现报错说是没有注册需要提供name

import router from  './router'

import store from  './store/'

import { VueAxios } from  './utils/request'

  

// mock

// WARNING: `mockjs` NOT SUPPORT `IE` PLEASE DO NOT USE IN `production` ENV.

// import './mock'

  

import bootstrap from  './core/bootstrap'

import  './core/lazy\_use'

import  './permission' // permission control

import  './utils/filter' // global filter

import  './components/global.less'

import { Dialog } from  '@/components'

import Comment from  '@/components/Comment/Comment'

  

Vue.config.productionTip = false

  

// mount axios Vue.$http and this.$http

Vue.use(VueAxios)

Vue.use(Dialog)

  

new  Vue({

router,

store,

created: bootstrap,

render: h =>  h(App, Comment)

}).$mount('#app')

按照网上的方法在main.js注册一下再使用发现还是报这个错, 具体也不知道错哪了


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

你的确没有注册a-comment,只是注册了comment组件


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...