Skip to content
Advertisement

How to impliment getter/setter for each button’s value inside vuetify v-btn-toggle?

I have a vuetify v-btn-toggle like this:

JavaScript

But the binding v-model is an array. How could I trigger individual toggled event for buttons A, B, C like this:

JavaScript

Advertisement

Answer

We have to create one method to read the state of buttons and other to set the state, all operations take place in the toggle_values.

JavaScript

If you want to play with the values and see they changing, add this:

JavaScript

Hope it helps! 😉

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement