SoFunction
Updated on 2025-04-11

Get the value instance in select

As shown below:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript" src="./"></script>
</head>
<body>
<label >
<select v-model="selected" >
 <option v-for="option in options" v-bind:value="">
 {{  }}
 </option>
</select>
<span>Selected: {{ selected }}</span>
</label>
<script>
new Vue({
 el: '#app',
 data: {
 selected: 'A',
 options: [
  { text: 'One', value: 'A' },
  { text: 'Two', value: 'B' },
  { text: 'Three', value: 'C' }
 ]
 }
})
</script>
</body>
</html>

The above article obtaining the value example in select is all the content I share with you. I hope you can give you a reference and I hope you can support me more.