首页 > 移动平台 > 详细

vue中axios的get和post

时间:2020-07-10 17:08:46      阅读:114      评论:0      收藏:0      [点我收藏+]

get

 this.$axios
          .get(
            "/hospital/get_by_id",
           {
             params:{
               id:this.$route.params.id
             }
           }           
          )
          .then(res => {
            console.log(res.data.data, "a");
            this.content = res.data.data;
          })
          .catch(error => {
            console.error(error);
          });

post

this.$axios
      .post(
        "/hospital/get_hospital",
        Qs.stringify({
          currentPage: "1",
          pageSize: "6",
          is_Hot: "1"
        })
      )
      .then(res => {
        console.log(res.data.data, "a");
        this.hosptialList = res.data.data.hospital.records.slice(0, 3);
       })
      .catch(error => {
        console.error(error);
      });

vue中axios的get和post

原文:https://www.cnblogs.com/caoxueyang/p/13280048.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!