編輯如下
...
@click="handleEdit(scope.$index, scope.row)">編輯</el-button> ...
使用 Object.assign 來傳值,如果直接用
this.editForm=row
來傳值,則編輯的時候會影響當行顯示
//編輯 handleEdit: function (index, row) { this.editFormVisible = true;//dialog對話窗口打開 this.editForm = Object.assign({}, row);//將數據傳入dialog頁面 this.editForm.index=index;//傳遞當前index }
參考;https://blog.csdn.net/weixin_42648692/article/details/103005916