⊗jsvuPmFmSl 49 of 72 menu

Working with select in Vue

Working with select is done in a similar way - the v-model attribute is attached to the tag, and the data object property is bound to it. The text of the selected option tag will be placed in this property.

The following code shows an example of how a drop-down list works:

data() { return { selected: 'value1', // default value } }
<template> <select v-model="selected"> <option>value1</option> <option>value2</option> <option>value3</option> </select> <p>{{ selected }}</p> </template>

Ask the user with select what city they live in. Make the selected city appear in a paragraph.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline