vuejs2+axios设置

http://www.cnblogs.com/wisewrong/p/6402183.html

1 当前项目安装axios

$ cnpm i axios --save-dev

2 import axios from 'axios';

axios.get('api/seller')
        .then((res) => {
        if (res.status === 200) {
          res = res.data;
          if (res.errno === ERR_OK) {
            this.seller = Object.assign({}, this.seller, res.data);
          }
        };
      })
      .catch(function(err) {
          console.log(err); // 从数据库获取数据出现问题
});
原文地址:https://www.cnblogs.com/easyweb/p/6710843.html