vuejs2+axios设置
Posted 码农的成长之路-Jeson
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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); // 从数据库获取数据出现问题 });
以上是关于vuejs2+axios设置的主要内容,如果未能解决你的问题,请参考以下文章
VSCode自定义代码片段14——Vue的axios网络请求封装
VSCode自定义代码片段14——Vue的axios网络请求封装