报错:'.sync' modifiers cannot update the iteration variable 'interfaceItem' itself.
将v-model直接绑定v-for的循环别名,会报错,因为这样绑定无法修改v-for源数组因为写入别名就跟修改函数形参一样。考虑使用一个对象数组并在对象属性上使用v-model。
可以通过index下标来引用所需数据,达到相同的目的。
<el-card
v-for="(interfaceItem, index) in modelInterfaceForm.interfaces"
class="m-bottom-10 card-storage"
:key="index"
>
<hc-modify-vm-netcard
:create-vm="true"
:interface-item.sync="modelInterfaceForm.interfaces[index]"
></hc-modify-vm-netcard>
</el-card>
网友评论