当前位置: 代码迷 >> 综合 >> [vue] <Input v-model=“item“>: You are binding v-model directly to a v-for iteration alias.
  详细解决方案

[vue] <Input v-model=“item“>: You are binding v-model directly to a v-for iteration alias.

热度:77   发布时间:2023-12-12 01:12:04.0

error

报错代码

报错信息
: 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.
原因在报警信息中说的很明显了,修改迭代器变量item相当于修改函数的内部变量,不会影响输入参数本身(list)

resolution

  相关解决方案