基于 http://mockjs.com, 他已经不维护了
我们是广联达的一个前端团队,自研了一套内部的 Tony-Design 大屏可视化组件,其中用到了mock,但官方不维护了,于是我们做了一部分维护和修复的工作,回馈给开源社区。
- fix: responseType 初始化失败,官方一直没修复,有很多相关 issue
- 引入了 @types/mockjs
npm i tony-mockjs
- 安装
glup
- 运行
glup
, 实时生成dist
目录内容
Mock.js is a simulation data generator to help the front-end to develop and prototype separate from the back-end progress and reduce some monotony particularly while writing automated tests.
The official site: http://mockjs.com
- Generate simulated data according to the data template
- Provide request/response mocking for ajax requests
Generate simulated data according to HTML-based templates
This library is loosely inspired by Elijah Manor's post Mocking Introduction, mennovanslooten/mockJSON, appendto/jquery-mockjax and victorquinn/chancejs.
If you have any questions, please feel free to ask through New Issue.
Make sure the problem you're addressing is reproducible. Use http://jsbin.com/ or http://jsfiddle.net/ to provide a test page. Indicate what browsers the issue can be reproduced in. What version of Mock.js is the issue reproducible in. Is it reproducible after updating to the latest version?
Mock.js is available under the terms of the MIT License.