I'm usingVue 3
andBootstrap 5
.
I have aselect
with multiple options. Now I'm displaying myoption.TEXT
and when I change something, thisvalue
will also be passed into my method. But when I change something, I want to passkey
(option.ID).
But I also want myv-model
to be myoption.ID
but show myoption.TEXT
.
How to achieve this without checking the method itself.
choose:
Option array:
[ { "ID": 1, "TEXT": "One" }, { "ID": 2, "TEXT": "Two" }, { "ID": 3, "TEXT": "Three" }, ]
option
The property value should be bound tooption.ID
: