I have this collection called servers which is like this: {id, name, code}. I have this select tag, I iterate over my servers collection and the data() with the model values.
<select v-model="serveur">
<option v-for="server in servers" :key="server.id" :value="server.name">
{{server.name}}
</option>
</select>
. . .
data () {
return {
serveur:'',
code:''
}
}
The value "server.name" selected is binded to the model "serveur". All of this works just fine, but I want the value "server.code to be binded to the model "code"
I can't figure out how to do this. I'm new to vuejs, like I've been working with vue for the first time only two days ago. This is also my first Stack Overflow "asks" so I hope I am being clear enough.
Thanks in advance.