Vue-multiselect: [Question] Setting prop defaults globally

Created on 1 Apr 2019  路  2Comments  路  Source: shentao/vue-multiselect

Sorry if this is in the docs, but when registering vue-multiselect globally is there a way to provide default values for properties? eg defaulting the showLabels prop to false instead of true.

Most helpful comment

I'd say, create a functional component that would work as a wrapper with some preexisting props that match your default config + pass all the other attributes, props and listeners to the real component. This is called a transparent component / wrapper.
Pretty useful!

All 2 comments

I'd say, create a functional component that would work as a wrapper with some preexisting props that match your default config + pass all the other attributes, props and listeners to the real component. This is called a transparent component / wrapper.
Pretty useful!

That's an excellent suggestion, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

volkanciloglu picture volkanciloglu  路  3Comments

hskrishna29 picture hskrishna29  路  3Comments

alexhyriavets picture alexhyriavets  路  3Comments

Uninen picture Uninen  路  4Comments

shsmad picture shsmad  路  3Comments