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;
            });
原文地址:https://www.cnblogs.com/cl94/p/12374466.html