【发布时间】:2019-12-06 14:45:56
【问题描述】:
我有一个这样的对象:
obj: {
'tags': {
'0': 'One',
'1': 'Two',
'2': 'Three',
'3': 'Four',
'4': 'Five',
'5': 'Six',
}
我这样做:
<div
v-for="(tag, index) in obj.tags">
<v-text-field
v-model="tag"
>
</v-text-field>
</div>
我想在 vuetify 文本字段中显示该值,但是当我执行 vfor 时,我收到以下消息:
<v-text-field v-model="tag">: You are binding v-model directly to a v-for iteration alias. This will not be able to modify the v-for source array because writing to the alias is like modifying a function local variable. Consider using an array of objects and use v-model on an object property instead.
我该怎么办?
【问题讨论】:
-
你不能把那个对象转换成一个数组吗?
标签: javascript vue.js vuetify.js