view-design / ViewUIPlus

An enterprise-level UI component library and front-end solution based on Vue.js 3
https://www.iviewui.com
Other
383 stars 133 forks source link

[Vue warn]: Component has already been registered in target app #336

Open zic-liu opened 11 months ago

zic-liu commented 11 months ago

vue 3.3.2 vite 4.3.5 view-ui-plus 1.3.14

in main.js:

import { createApp } from 'vue'
import App from './App.vue'
import ViewUIPlus from 'view-ui-plus'
import 'view-ui-plus/dist/styles/viewuiplus.css'
const app = createApp(App)

app.use(store)
  .use(router)
  .use(ViewUIPlus)
  .mount('#app')

I got the error:

[Vue warn]: Component "Avatar" has already been registered in target app [Vue warn]: Component "Calendar" has already been registered in target app [Vue warn]: Component "Grid" has already been registered in target app [Vue warn]: Component "Link" has already been registered in target app ... [Vue warn]: Invalid prop: custom validator check failed for prop "type".

In my project, I use Element-plus and Ant-design, too. I have no idea why I get the warn. Need any help, please.

ymsyuni commented 11 months ago

将ViewUIPlus引入放到App引入前面,这样

import { createApp } from 'vue' import ViewUIPlus from 'view-ui-plus' import App from './App.vue' import router from './router' import store from './store' import 'view-ui-plus/dist/styles/viewuiplus.css'

const app = createApp(App)

app.use(store) .use(router) .use(ViewUIPlus) .mount('#app')