-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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不支持 fetch吗? #163
Comments
好像是不支持,只支持ajax. |
不支持,可用robe-ajax |
可以试试parrot-mocker-web,支持xhr/jsonp/fetch |
Closed
貌似作者已经不维护了,下面是一个支持拦截 使用的话: npm install @zjffun/mockjs
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
let mock = require('mockjs');
const url_get = config.apiHost+"";
mock.mock(url_get,'GET',{
'list|1-10': [{
'id|+1': 1
}]
});
fetch(url_get).then(resp=>{
console.log(resp.getJson());
})
fetch不被拦截?
The text was updated successfully, but these errors were encountered: