【发布时间】:2020-02-11 11:37:04
【问题描述】:
有没有办法使用v-select 来显示数组的值?我需要列出这个数组的str 值:
myArr: [
{ key: 'one', str: '1st' },
{ key: 'two', str: '2nd' },
{ key: 'three', str: '3rd' },
{ key: 'four', str: '4th' }
]
在v-select,但不知道该怎么做。到目前为止,我已经完成了这项工作:
<v-select v-model="vCase.eligibility" :items="eligPeriods[0].str"></v-select>
它在v-select 中显示“1st”。但我需要显示所有值。
我尝试使用模板:
<template v-slot:myArr="{item}">
<v-select v-model="myVar.selectedVal" :items="item[str]"></v-select>
</template>
但它甚至不会在页面上呈现。
有什么帮助或建议吗?
【问题讨论】: