午后南杂
Home
Categories
Categories
essay
frontEnd
article
other
Three-Month
backEnd
Tags
Tags
随笔
面试
webpack
apple
github
fetch
vuepress
gitlab
runner
vue
node
Three-Month
博客主题
npm
rect
个人信息
vuex
小程序
wxParse
javascript
cdn
hexo
mongoDB
keystoneJS
shadowscoks
Contact
Contact
GitHub
open in new window
Home
Categories
Categories
essay
frontEnd
article
other
Three-Month
backEnd
Tags
Tags
随笔
面试
webpack
apple
github
fetch
vuepress
gitlab
runner
vue
node
Three-Month
博客主题
npm
rect
个人信息
vuex
小程序
wxParse
javascript
cdn
hexo
mongoDB
keystoneJS
shadowscoks
Contact
Contact
GitHub
open in new window
Appearance
随笔
18
面试
1
webpack
4
apple
1
github
1
fetch
2
vuepress
3
gitlab
1
runner
1
vue
6
node
1
Three-Month
1
博客主题
1
npm
1
rect
1
个人信息
1
vuex
1
小程序
4
wxParse
1
javascript
2
cdn
1
hexo
1
mongoDB
2
keystoneJS
1
shadowscoks
1
First NPM Package
Abstract
fetch的封装
npm address
vuepress-theme-reco的开发
npm address
reco_luan
2019-01-22 08:00:00
Three-Month
fetch vuepress
reco-fetch
TIP
fetch
必然要替换
XMLHttpRequest
,所以是时候尝试
fetch
了;
本封装仅针对npm引入;
本封装依赖
es6-promise
和
whatwg-fetch
,分别对
promise
和
fetch
进行兼容性处理;
还有一种兼容性处理是依赖
es6-promise
和
isomorphic-fetch
,但是看它的源码就会发现,
isomorphic-fetch
只不过是引用了
whatwg-fetch
,并没有做二次开发,
isomorphic-fetch
只是将fetch添加为全局,以便其API在客户端和服务器之间保持一致,所以没必要。
reco_luan
2018-09-13 08:00:00
frontEnd
npm fetch vue rect