vue編輯當行數據,彈窗賦值


編輯如下

...
@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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM