Looking for help with Vue2 looping to display multiple options within a select element.
We have an object structured like this;
sorting = {
name: [
'asc',
'desc'
],
price: [
'cheapest',
'expensive'
]
}
How can we set up the loop to achieve the desired output below?
<select>
<option value="name:asc">name asc</option>
<option value="name:desc">name desc</option>
<option value="price:cheapest">price cheapest</option>
<option value="price:expensive">price expensive</option>
</select>
Struggling to figure out how to include the second option listed above;
<select id="sortBy" class="form-control pr-3" v-model="sortBy">
<option
v-for="(options, sort) in sorting" :key="`${sort}`"
v-bind:value="`${sort}:${options[0]}`"
>
{{ sort }} {{ options[0] }}
</option>
</select>