-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mock 支持 #2
Comments
引用 mockjs 的 mock 方法可以直接引文件: import {mock} from 'mockjs/src/mock';
mock(data) |
其他的 mock 数据生成方案: |
请求 {
"success": true,
"data": {
"id": 3,
"name": "Melissa Moore"
}
} 对于这个的实现 目前考虑到有 几种实现方式
var movie = {
'id|+1': 1,
'name': '@Name',
}; 但是在代理层在 使用
|
请求 |
确定下 : 如果要实现上述分页需求 让用户 去用 function 实现 . 即 |
如果这样的话 |
从使用的角度整理下看怎么用更好呢? |
可以我去整理下 各种场景 |
基于
proxy.config.js
,扩展类型为 plainObject 的情况,支持 Mock.js。使用方式如下:
请求
/movies
,返回:请求
/movies/3
,返回:The text was updated successfully, but these errors were encountered: