Home > Article > Web Front-end > How to get the value in select in vue.js (detailed tutorial)
Now I will share with you an article about vue.js to get the value instance in select. It has a good reference value and I hope it will be helpful to everyone.
is as follows:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <script type="text/javascript" src="./vue.js"></script> </head> <body> <label id="app"> <select v-model="selected" > <option v-for="option in options" v-bind:value="option.value"> {{ option.text }} </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 is what I compiled for everyone. I hope it will be helpful to everyone in the future.
Related articles:
Using Vue's routing permission management Questions about (detailed tutorial)
About the method of inserting variable parameters in vue.js tag attributes (detailed tutorial)
The above is the detailed content of How to get the value in select in vue.js (detailed tutorial). For more information, please follow other related articles on the PHP Chinese website!