search

Home  >  Q&A  >  body text

javascript - How to get option text in VUE

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?

扔个三星炸死你扔个三星炸死你2758 days ago891

reply all(3)I'll reply

  • typecho

    typecho2017-06-12 09:34:00

    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)

    reply
    0
  • 天蓬老师

    天蓬老师2017-06-12 09:34:00

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

    Maybe it can help you

    reply
    0
  • 滿天的星座

    滿天的星座2017-06-12 09:34:00

    vue official website example


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

    reply
    0
  • Cancelreply