Vue-multiselect: Provide dist to use without toolchain

Created on 30 Jun 2016  路  10Comments  路  Source: shentao/vue-multiselect

Vue itself is provided as a single JS file, which I can simply include in the HTML header and I'm good to go.

I'd love for vue-multiset to provide the same (just a single JS and CSS file). You could then use Vue.use to register the plugin.

question

All 10 comments

I'm on vacation right now so I can't check it myself, but it should work (at least partially) as the dist file is an umd module.

I have tried it multiple things:

  • If I use Vue.use(VueMultiselect), it tells me that no apply()-method is defined.
  • If I register it with Vue.component(VueMultiselect) or locally in the components: [VueMultiselect], it tells me that the component should "provide a "name" or "id" field".
  • If I register it with a name like components: {"multiselect": VueMultiselect}, it turns into a Fragment instance and the props are all ignored.

I used the lib/vue-multiselect.js file (only that one). Also, that directory does not contain a .css-file.

I have a feeling that I could be overlooking something here. If I do, please don't hurt me :)

The css code is inside the js file. It might require just a small tweak to the exporting code. I will look into it after I'm back home, so next week.

Any updates on this?

Probably today!

@LukasKnuth It鈥檚 not often I use the global scope so I had to check it myself somewhere. You can register the component like this:
Globally:

Vue.component('Multiselect', VueMultiselect.Multiselect)

or locally:

new Vue({
  components: {
    multiselect: VueMultiselect.Multiselect
  },
  ...stuff here
})

It didn鈥檛 work with simply registering Vue.component(VueMultiselect) as there are more files exposed in the module, that鈥檚 why you have to explicitly request for the VueMultiselect.Multiselect component.

Works great, thanks for taking the time. Cheers!

No problem! Thanks for pointing it out. I should add this somewhere in the docs / readme.

I should add this somewhere in the docs / readme.

You really should, it took me hours to find this thread ^_^

Really nice plugin! Thanks.

CSS is still not separated in dist which makes it difficult to customize.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stefanheimann picture stefanheimann  路  4Comments

katranci picture katranci  路  3Comments

focussing picture focussing  路  3Comments

hskrishna29 picture hskrishna29  路  3Comments

icebob picture icebob  路  4Comments