javascript - How to get option text in VUE
扔个三星炸死你
扔个三星炸死你 2017-06-12 09:32:00
0
3
888

select can directly obtain the selected val.
How to obtain the selected text?
Is there a quick way?
Can I still only use native loops?

扔个三星炸死你
扔个三星炸死你

reply all(3)
typecho

1. The method above can be obtained by obtaining the DOM. 2. Traverse the list through a specific value and obtain the text. 3. Establish the mapping between value and label through objects, which can improve the efficiency of data acquisition. (recommended)

Peter_Zhu

html5 api this.$refs.mySelector.querySelector('option[selected]').innerText querySelector

Maybe it can help you

滿天的星座

vue official website example


That’s what I should be talking about. I feel like the questioner has never read the official manual

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template