get的两种请求:

                methods:{
//axios.get的发送参数有两种,两个ajax请求函数都可实现
sendGetByStr(){
//1.get通过直接发字符串拼接
axios.get(`get.php?name=${this.users.name}&age=${this.users.name}`)
.then(function (response) {
console.log(response.data);
})
.catch(function (error) {
console.log(error);
}); },
sendGetByObj(){
//2.get通过params选项
axios.get(`get.php?`,{
params:{
name:this.users.name,
age:this.users.age
}
})
.then(function (response) {
console.log(response.data);
})
.catch(function (error) {
console.log(error);
}); }
}
})

post的一种

methods:{
sendPsot(){ axios.post('post.php', {
name: this.users.name,
age: this.users.age,
}) .then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
} }

最新文章

  1. SQL Server 2016 CTP2.2 安装手记
  2. C++高精度计时器——微秒级时间统计
  3. Linux下配置Node.js环境
  4. 2、python,for..in语句
  5. EUI ToggleButton ToggleSwitch 实现类似音乐开关按钮
  6. Android九宫格界面实现点击每个格点击跳转界面
  7. Sum of Left Leaves
  8. 转自:C#中TextBox水印提示的简单实现
  9. windows 2003 server 远程桌面禁用本地资源,磁盘驱动器,串行口,复制文件
  10. golang与C交互:cgo
  11. [书目20131223]Android、iPhone、Windows Phone手机网页及网站设计:最佳实践与设计精粹 - 张亚飞
  12. QQ群里收集的外企iOS开发的笔试题
  13. bzoj1029
  14. java多线程学习(两)——创建一个线程
  15. 教你一步搭建Flume分布式日志系统
  16. 【剑指offer】丑数
  17. WebStorm10 控制台中文乱码解决方案
  18. 初识MySQL数据库的各种CMD命令窗口下的指令
  19. Linux终端命令
  20. uva-10422-骑士-搜索题

热门文章

  1. Hander创建消息
  2. 008-centos6.5搭建web服务【nginx-tomcat8-jre8】
  3. vlc的流输出功能
  4. idea忽略隐藏文件、文件夹的设置操作
  5. partprobe 和 partx 的用法
  6. linux之反向代理,反向代理实例,负载均衡实例
  7. Linux学习笔记:shell
  8. 【18.065】Lecture1
  9. python之xml数据解析
  10. hdoj1520(入门树形dp)