My objective is to have a dropdown list with "title 1234" appearing first. When this option is selected, its value should be 1234. How can I achieve this?
Here is the desired outcome:
https://i.sstatic.net/CqWgn.png
Currently, the list looks like this:
https://i.sstatic.net/J61up.png
Vue.createApp({
data: () => ({
model: 'title 1234',
options: {
1234: 'title 1234',
1: 'title 1',
2: 'title 2',
3: 'title 3',
10: 'title 10',
},
})
}).mount('#app')
<div id="app">
<select v-model="model">
<option v-for="option in options">
{{ option }}
</option>
</select>
<span>Value: {{ model }}</span>
</div>
<script src="https://unpkg.com/vue@next"></script>
<script src="app.js"></script>