vue之axios

github地址:https://github.com/axios/axios

安装:npm install axios --save  

导入:

import axios from 'axios';

使用:

    methods:{
      //获取网络数据
      reqData(){
        axios.get('http://127.0.0.1:8080').then((response)=>{
          console.log(response);
        }).catch((error)=>{
          console.log(error);

        })

原文地址:https://www.cnblogs.com/jingzaixin/p/12828134.html