Skip to content
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 #332

Closed
472756921 opened this issue Apr 15, 2018 · 2 comments
Closed

如何配置mock #332

472756921 opened this issue Apr 15, 2018 · 2 comments

Comments

@472756921
Copy link

.umirc.mock.js应该怎么配置?

@sorrycc
Copy link
Member

sorrycc commented Apr 16, 2018

@sorrycc sorrycc closed this as completed Apr 16, 2018
@huangshunping
Copy link

@sorrycc 我遇到一样的问题

我现在版本是1.3.16,按照官方文档 配置,无法访问到mock数据

最后解决是在.umirc.mock.js里面配置:

const mock = {}
require('fs').readdirSync(require('path').join(__dirname + '/mock')).forEach(function(file) {
Object.assign(mock, require('./mock/' + file))
})

export default mock;

参考:.umirc.mock.js

请问是我哪里配置的不对,还是就应该这样做?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants