Mock
Mock copied to clipboard
Random.dataImage方法异常
npm install mockjs; // 1.0.1-beta2
执行: Mock.Random.dataImage()
异常信息: /node_modules/mockjs/dist/mock.js:1471 var Canvas = module.require('canvas') ^
TypeError: module.require is not a function
nodejs不支持canvas渲染,所以无法实现dataImage方法,只能用image方法了,不过也够用了
只是想用nodejs生成一些数据,用ajax请求过来用