We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
目前在react项目中使用mock,参照官方示例,并未达到拦截的效果,是因为不支持fetch吗,还是说在react中需要特别的配置,可否给出react的示列,或者明确说明是否支持fetch?
The text was updated successfully, but these errors were encountered:
Duplicate of #163
Sorry, something went wrong.
貌似作者已经不维护了,下面是一个支持拦截 fetch 的版本 zjffun/Mock-support-intercept-fetch
fetch
使用的话:
npm install @zjffun/mockjs
fetch 的拦截还是比较好实现的,因为拦截后返回 resolve 为 response 对象(通过 Response - Web APIs | MDN 创建)的 promise 对象就行。
No branches or pull requests
目前在react项目中使用mock,参照官方示例,并未达到拦截的效果,是因为不支持fetch吗,还是说在react中需要特别的配置,可否给出react的示列,或者明确说明是否支持fetch?
The text was updated successfully, but these errors were encountered: