Vue-multiselect: Unknown custom element <multiselect>

Created on 3 Oct 2017  路  2Comments  路  Source: shentao/vue-multiselect


Hi!

I love the work done on this project. I was just wondering if anyone could shed some light on why I am getting the error:
[Vue warn]: Unknown custom element: <multiselect> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

This happens when I try to register it globally via Vue.use

I've set-up a sample app through Webpackbin, since the JSFiddle won't be able to show the full extent of how everything is interacting.

You could also reproduce it by creating a new Vue project and adding:

import { Multiselect } from 'vue-multiselect'

Vue.use(Multiselect)

There aren't any problems, though, when importing locally, in a single component.

help wanted

Most helpful comment

Hi @RIanDeLaCruz, thanks for using vue-multiselect!

I don't think you're including it the right way. Please refer to the docs to see the example, you seem to be doing two things wrong:

  1. Use default import instead of named import, i.e. import Moultiselect from 'vue-multiselect', not import { Moultiselect } from 'vue-multiselect'
  2. Multiselect is simply a component, not a plugin, so you should include it using Vue.component('multiselect', Multiselect) rather than Vue.use(Multiselect)

After fixing those two issues it seems like I got vue-multiselect working. Your confusion might be caused by the recent update of the docs, am I right @shentao?

All 2 comments

Hi @RIanDeLaCruz, thanks for using vue-multiselect!

I don't think you're including it the right way. Please refer to the docs to see the example, you seem to be doing two things wrong:

  1. Use default import instead of named import, i.e. import Moultiselect from 'vue-multiselect', not import { Moultiselect } from 'vue-multiselect'
  2. Multiselect is simply a component, not a plugin, so you should include it using Vue.component('multiselect', Multiselect) rather than Vue.use(Multiselect)

After fixing those two issues it seems like I got vue-multiselect working. Your confusion might be caused by the recent update of the docs, am I right @shentao?

Look like that is the issue. Thanks @Zip753

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andreasvirkus picture andreasvirkus  路  3Comments

stefanheimann picture stefanheimann  路  4Comments

PrimozRome picture PrimozRome  路  3Comments

alexhyriavets picture alexhyriavets  路  3Comments

icebob picture icebob  路  4Comments