element取表格对应id数据
<el-button size="mini" type="danger" @click="editor(scope.row)">编辑</el-button>
editor(row) {
this.dialogTableVisible = true;
this.id = row.id;
var item = this.tableData[this.id - 1];
this.form.name = item.name;
this.form.mobi = item.mobi;
this.form.account = item.account;
this.form.line = item.line;
}
第二种写法
<el-button size="mini" type="danger" @click="editor(scope.row)">编辑</el-button>
editor(row) {
this.dialogTableVisible = true;
this.id = row.id;
this.$axios({
url: api/index.php/admin/mod/' + this.id,
method: 'post'
}).then(res => {
// console.log(res.data.name);
var item = res.data;
this.form.name = item.name;
this.form.mobi = item.mobi;
this.form.account = item.account;
this.form.line = item.line;
}).catch(err => {
console.log(err)
})
}
最新文章
- JS定义数组,初始化
- EntityFramework之摸索EF底层(八)
- EF架构~通过EF6的DbCommand拦截器来实现数据库读写分离
- SPSS数据分析—描述性统计分析
- 关于Function.prototype.bind
- PySpark操作HBase时设置scan参数
- PHP数组的操作
- javascript随手记
- nginx 2.基本配置
- C#中string的小结
- dbunit进行DAO层Excel单元测试
- 通信机制-TCP/IP、Http、Socket的区别
- 关于json对象的深拷贝
- zblog如何更改数据库配置以及生效
- mysql写注释的几种方法
- HP服务器设置iLO步凑
- supervisor 管理 celery
- tomcat之日志切割
- MT【90】图论基础知识及相关例题
- Jenkins进阶-远程构建任务(4)
热门文章
- [翻译] .NET Core 3.0 Preview 9 发布
- lightoj 1030-B - Discovering Gold (概率dp)
- python简介及详细安装方法
- 我的MarkDown入门
- SpringBoot使用注解的方式构建Elasticsearch查询语句,实现多条件的复杂查询
- 高级部分_委托、Lambda表达式、事件
- .Net基础篇_学习笔记_第六天_for循环的嵌套_乘法口诀表
- centos安装流量监控软件,并指定端口号监控
- Javaweb设置session过期时间
- Python 开发植物大战僵尸游戏