我正在使用 buefy <b-autocomplete>
组件,并且有一个名为 v-model
的属性将值绑定到输入字段
now I wanna bind Full Name into the field but the data consist with list[index].first_name
and list[index].last_name
, and the index
is from a v-for
loop .
由于 v-model
不能绑定函数(它有特定的索引,所以我不能将它连接到 computed
然后传递它)所以它要么是 v-model="list[index].first_name"
要么 v-model="list[index].last_name"
我如何让它绑定这两个?
原文由 Travis Su 发布,翻译遵循 CC BY-SA 4.0 许可协议
您需要一个为全名计算的可设置,您可以对其进行 v-model 。你只需要决定一个规则,额外的空间去哪里,如果没有空间怎么办。