Is there a way to use a v-select
to display the values of an array? I need to list the str
values of this array:
myArr: [
{ key: 'one', str: '1st' },
{ key: 'two', str: '2nd' },
{ key: 'three', str: '3rd' },
{ key: 'four', str: '4th' }
]
in the v-select
but can't figure out how to do it. So far I've got this working:
<v-select v-model="vCase.eligibility" :items="eligPeriods[0].str"></v-select>
It displays "1st" in the v-select
. But I need all the values to display.
I tried using a template:
<template v-slot:myArr="{item}">
<v-select v-model="myVar.selectedVal" :items="item[str]"></v-select>
</template>
but then it doesn't even render on the page.
Any help or advice?