1、安装axios
npm install axios
2、在使用的地方导入
import axios from 'axios'
3、再方法中调用
sendHttp: function () {
axios.get('http://xxx/fileUpload')
.then(response => (this.info = response))
.catch(function (error) { // 请求失败处理
console.log(error)
})
}
作者:Work Hard Work Smart
出处:http://www.cnblogs.com/linlf03/
欢迎任何形式的转载,未经作者同意,请保留此段声明!
浙公网安备 33010602011771号