Answer the question
In order to leave comments, you need to log in
How to pass v-model to child component?
I'm using this plugin https://github.com/euvl/vue-js-toggle-button and I'd like to override default props values.
Following an example from the Internet, I made this component:
<template>
<toggle-button v-bind="$attrs"
:color="color"
:height="height"
:width="width"
:fontSize="fontSize"
:labels="labels"/>
</template>
<script>
export default {
name: 'Toggle',
props: {
name: {
type: String
},
color: {
type: [String, Object],
default: '#09757A'
},
height: {
type: Number,
default: 26
},
width: {
type: Number,
default: 60
},
labels: {
type: [Boolean, Object],
default: () => {
return {checked: 'YES', unchecked: 'NO'}
},
},
fontSize: {
type: Number,
default: 11
}
}
}
</script>
<toggle name="alt_currency_status" v-model="alt_currency_status"/>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question