铁路校友-我拆过的坑cycx

主页:www.j6f.cn知识星球,快手号、抖音号、视频号、微信公众号、百家号、个人博客网站,同名。

vue axios 先npm install --save axios 再使用

// 为给定 ID 的 user 创建请求

axios.get('/user?ID=12345').then(function (response) {

  console.log(response);

}).catch(function (error) {

  console.log(error);

});

 

// 上面的请求也可以这样做

axios.get('/user', {

  params: {

    ID: 12345

  }

}).then(function (response) {

  console.log(response);

}).catch(function (error) {

  console.log(error);

});


发表评论:

Powered By Z-BlogPHP 1.7.3

Copyright Your WebSite.Some Rights Reserved.