V-model WITHOUT input or select

Hey guys.
I was wondering if is there possibility to use v-model functionality for elements OTHER than input or select.

For example I have a couple of divs which I use to get a choice from user, in exchange of input/select element.

And I want to work it likewise an input with v-model property

Had anyone of you tried such a concept?

Using v-model like that is not possible.

v-model is essentially syntax sugar (and some extra logic) to handle the :value and @input/change events on form elements.

2 Likes

v-model wouldn’t work but what you can do is add hidden input fields and read their values since you wanna use divs instead of select.

1 Like