ajax 或者 axios 或调函数中 指向vue 实例
来源:互联网 发布:金星秀停播原因知乎 编辑:程序博客网 时间:2024/05/24 07:01
1.箭头函数(resp) => {//函数体}或者function (res) {}.bind(this)
axios.post('/app/user/loginSubmit',data) .then(function(res){ if(res.data){ this.error = ''; window.location.href = '/'; }else { this.error = '帐号或者密码错误'; } //console.log(res); }.bind(this)) .catch(function(err){ //console.log(err); });axios.post('/app/user/loginSubmit',data) .then((res)=>{ if(res.data){ this.error = ''; window.location.href = '/'; }else { this.error = '帐号或者密码错误'; } })
0 0
- ajax 或者 axios 或调函数中 指向vue 实例
- Vue axios中this的指向问题
- vue使用axios中 this 指向问题
- axios --Vue使用Ajax
- vue中选择 axios 来完成 ajax 请求。
- jQuery AJAX回调函数this指向问题
- jQuery AJAX回调函数this指向问题
- Vue.js中使用axios
- vue中axios的使用方法
- vue 中axios的封装
- vue中axios 使用实践
- vue+axios方法封装(restful,ajax)
- vue发送ajax --axios入门介绍
- vuejs中vue-resource或使用axios发送请求及解决跨域问题
- 自定义函数或者回调函数中调用对话框对象
- ajax回调函数
- Ajax 回调函数
- ajax几种回调函数
- 海康SDK开发笔记(一)
- Lua基础笔记
- RuntimeError: module compiled against API version 0xa but this version of numpy is 0x9
- OVS 配置虚机vlan
- Emmeet代码缩写示范(网页)
- ajax 或者 axios 或调函数中 指向vue 实例
- 从头开始
- JDK动态代理源码分析
- Windows 上的Oracle 迁移到Linux上的方法
- 物联网技术西电捷通TRAIS符合性检测系统的应用研究
- touch事件分析
- hibernate的检索策略
- Java 线程面试题 Top 50(转 ImportNew)
- 2017.2.17总结