vue+json-server+axios 模拟后台数据请求
参考资料:https://github.com/typicode/json-server
安装 json-server
npm install -g json-server
在 vue 根目录下创建 db.json 文件
严格按照 json 格式写入数据(不然会报错!!!),如
{
"logins": [
{
"account": "张三",
"password": "123"
},
{
"account": "李四",
"password": "456"
}
]
}