Vue 中Axios 使用

时间:2019-05-31 14:45:37   收藏:0   阅读:104

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)
        })
    }

  





原文:https://www.cnblogs.com/linlf03/p/10955082.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!