1.1 axios 简介与安装
1、axios简介
1. vue本身不支持发送AJAX请求,需要使用vue-resource、axios等插件实现 2. axios是一个基于Promise的HTTP请求客户端,用来发送请求,也是vue2.0官方推荐的,同时不再对vue-resource进行更新和维护 3. 参考:GitHub上搜索axios,查看API文档:https://github.com/axios/axios
2、安装axios
1. npm install axios -S # 也可直接下载axios.min.js文件 2. 下载后即到 C:Users om ode_modulesaxiosdist 路径下找到 axios.min.js 文件
1.2 axios 基本用法
1、 axios最基本使用
get: axios最基本get请求参数 post: axios发送最基本post请求参数
2、axios借助Qs对提交数据进行序列化
axios参考博客:https://www.jianshu.com/p/68d81da4e1ad https://www.cnblogs.com/yiyi17/p/9409249.html