動態綁定 input v-model

背景:vue + element 項目中 v-for 循環生成 input,想要把數組的每一個值綁定到 input 的 vue

         v-model 上,該如何動態綁定?數組

解決方法:bash

在這裏咱們使用的數組格式爲 [1,2,3...]spa

<div v-for="(item, index, key) in arr">
       <el-input
         v-model="arr[index]"
         clearable>
       </el-input>
</div>複製代碼

ok!大功告成~code

相關文章
相關標籤/搜索