Trying to display multiple options in Vue2 for loop of a select.
Given an object with the structure;
{
name: [
'asc',
'desc'
],
price: [
'cheapest',
'expensive'
]
}
How to format the loop to get the output of;
<select>
<option value="name:asc">name asc</option>
<option value="name:desc">name desc</option>
<option value="price:cheapest">name cheapest</option>
<option value="price:expensive">name expensive</option>
</select>
Can’t work out the way to show the second option;
<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>