Vue.js踩坑记录
0

Vue.js踩坑记录

已有 4423 人阅读此文 - - 胖大豆
  1. vue 使用 axios 获取数据

    login:() => {
        this.$http.get('/api/Login',{username:'xxxxxx',password:'123456'});
    }

    一直报错,Error in created hook: "TypeError: Cannot read property 'get' of undefined",
             费了半天时间,在箭头函数中这么写就是错误的,在普通函数中就是没有问题

    login:function(){
               this.$http.get('/api/Login',{username:'xxxxxx',password:'123456'});
    }

    这么调用就没有问题

相关文章!