日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

修改数据,如何将原数据带到输入框

發(fā)布時(shí)間:2025/3/21 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 修改数据,如何将原数据带到输入框 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

需求:

  • 對數(shù)據(jù)進(jìn)行修改時(shí),將原本的數(shù)據(jù)顯示到輸入框中

代碼展示

<template><div><el-table:data="tableData"borderstripeheight="250"style="width:100%"><el-table-columntype="selection"width="50"></el-table-column><el-table-columnprop="id"label="ID"align='center'width="70"> <template slot-scope="scope"><span style="margin-left: 10px">{{ scope.row.id }}</span> //數(shù)據(jù)的ID</template></el-table-column><el-table-columnprop="DWMC"label="單位名稱"align='center'width="130"></el-table-column><el-table-columnprop="name" label="操作"fixed="right"align="center"width="300"><template slot-scope="scope"><el-button size='mini' type="primary" @click="changeuser(scope.$index,scope.row,scope.row.id)">修改</el-button> <el-button size='mini' type="danger" @click="deluser(scope.row.id)">刪除</el-button> </template></el-table-column> </el-table></div> </template> <script>export default{data(){return {// 綁定數(shù)據(jù)form: {DWMC:'', },}},methods:{changeuser(index,row,id){ this.form.DWMC = row.DWMC // 將輸入框中的綁定數(shù)據(jù)替換成表格展示的數(shù)據(jù),就完成了需求 }}} </script>

代碼講解

效果

  • 這樣就完成需求了
《新程序員》:云原生和全面數(shù)字化實(shí)踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀

總結(jié)

以上是生活随笔為你收集整理的修改数据,如何将原数据带到输入框的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。