vue axios的使用


npm install axios --save
为什么不加 --dev ,因为线上依然要使用它

之后需要导入它
import axios from 'axios';

实际使用:

 

      axios({
                url:'http://www.xx.com/xx.php',
                //method:'get',
                params:{
                    size:24,
                    catid:54,
                    mall:1
                }
            }).then(res => {
                this.malls = res.data;
                console.log(this.malls)
                return res;
            });

 

posted @ 2020-02-27 21:17  cl94  阅读(141)  评论(0编辑  收藏  举报