to be able to send props to a Vuetify component without needing to assign each one within my component, is there a way I can just mass pass in all of the props?
Below is what i’m currently doing, however there’s a lot of prop’.
there is attempted to simply extend the VSelect component, however this returns multiple errors which don’t seem simple to fix!
<template>
<v-flex xs12 sm6>
<v-select v-model=”selected” :items=”data”
:label=”label”
:multiple=”multiple”
:chips=”chips”
:hint=”hint”
:persistent-hint=”persistentHint”
:counter=”counter”
:dark=”dark”
\></v-select>
</v-flex>
</template>
<script>
export default {
props: {
label: {
default: false,
type: String|Boolean
},
multiple: {
default: true,
type: Boolean
},
chips: {
default: true,
type: Boolean
},
hint: {
default: ‘’,
type: String|Boolean
},
persistentHint: {
default: this.hint !== ‘’ || this.hint !== false,
type: String|Boolean
},
counter: {
default: false,
type: Number|Boolean
},
dark: {
default: false,
type: Boolean
},
},
data: function() {
return {
selected: [ ],
data: [
‘test’, ‘test2’, ‘test3’
]
}
}
}
</script>
Solution :
You can pass props as an object:
<v-select
v-model=”selected”
:items=”data”
v-bind=”$props”
\></v-select>
[ https://vuejs.org/v2/guide/components-props.html#Passing-the-Properties-of-an-Object ]