Home > Web Front-end > JS Tutorial > Use the select drop-down box to implement binding and value methods in vue.js

Use the select drop-down box to implement binding and value methods in vue.js

亚连
Release: 2018-06-01 16:01:56
Original
3405 people have browsed it

Below I will share with you an article about vue.js select drop-down box binding and value acquisition methods. It has a good reference value and I hope it will be helpful to everyone.

Recently I was working on a mui vue.js mobile project and encountered this problem, so I recorded it:

1. The code for binding the select drop-down box is very simple. sendlist is a collection of drop-down boxes. You can see the vue.js documentation for this:

Address: https://cn.vuejs.org/v2/api/

:The value bound by value is the value corresponding to this drop-down box

<select id="sendSybol" v-model="searchDto.sendSymbolId"> 
  <option v-for="send in sendList" name="sendSymbolId" :value="send.VALUE" >{{send.CODE}}</option> 
</select>
Copy after login

2. To get the value, just get the drop-down box directly, and the attribute bound by v-model can be used

The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.

Related articles:

A brief discussion on Webpack persistent caching practice

Lightweight JS Cookie plug-in js-cookie Usage method

JS animation timer knowledge summary

The above is the detailed content of Use the select drop-down box to implement binding and value methods in vue.js. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template