转载自:https://www.cnblogs.com/qq254980080/p/10441848.html
防止木了
主要原因是:
在 then的内部不能使用Vue的实例化的this, 因为在内部 this 没有被绑定
在then的内部,console.log(this),输出undefined
解决办法:
在请求axios外面定义一下 let that = this
内部用:that.info = repos.data
转载自:https://www.cnblogs.com/qq254980080/p/10441848.html
防止木了
主要原因是:
在 then的内部不能使用Vue的实例化的this, 因为在内部 this 没有被绑定
在then的内部,console.log(this),输出undefined
解决办法:
在请求axios外面定义一下 let that = this
内部用:that.info = repos.data