a fetch polyfill(es6 style)
npm install ywl-fetch --save
;
import 'ywl-fetch'
fetch('./mock/a.json')
.then(function (response) {
return response.json()
}).then(json => {
console.info(json)
})
<script src="./dist/fetch-polyfill.js"></script>
<script>
fetch('./mock/a.json')
.then(function (response) {
return response.json()
}).then(json => {
console.info(json)
})
</script>
ie10+ or chrome etc.