Skip to content

ccwq/Mock

 
 

Repository files navigation

Mock.js - async version

仅修改Mock.mock方法使支持Promise异步数据替换

安装:

yarn add -D mockjs-async 

or

npm install --save mockjs-async

使用:

import Mock from "mockjs-async"

Mock.mock(/foo\/bar/, function(){
    return new Promise(resolve=>{
        setTimeout(resolve, 3000, {data:"模拟的数据"});
    })
})

Build Status

mockjs完整功能,请查阅 原版主页

本项目主页:https://github.com/ccwq/Mock

About

A simulation data generator

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.5%
  • HTML 0.5%