1.命令安装axios和vue-axios
npm install axios --save
npm install vue-axios --save2.package.json查看版本

3.在main.js中引用
import axios from 'axios';
import VueAxios from 'vue-axios';
Vue.use(VueAxios,axios)4.如何使用
(初始化方法)
将下列代码放在Home.vue中:
export default {
name: 'HomeView',
下边即可
methods:{
    getList(){
      this.axios.get('http://localhost:3312/user/getList',{
        params:{
          page:this.query.page,
          size:this.query.size,
          name:this.query.name,
          phone:this.query.phone,
          city:this.query.city
        }
      }).then((resp)=>{
        console.log(resp);
        this.tableDate =resp.data,content.list;
        this.total=resp.data.content.total;
      })
    },
  }















![[云顶数模]2024美赛CEF题成品参考论文+配套数据集+可执行代码+运行结果图](https://img-blog.csdnimg.cn/direct/c91e17cb80ea4cdd96a6de4a41570a69.png)



