使用cross-fetch替换node-fetch和isomorphic-fetch

Terwer 前端开发评论227字数 93阅读0分18秒阅读模式

安装文章源自浅海拾贝-https://blog.terwergreen.com/use-crossfetch-to-replace-nodefetch-and-isomorphicfetch-wbuqq.html

yarn add cross-fetch

使用文章源自浅海拾贝-https://blog.terwergreen.com/use-crossfetch-to-replace-nodefetch-and-isomorphicfetch-wbuqq.html

import fetch from 'cross-fetch';

polyfill的使用方式文章源自浅海拾贝-https://blog.terwergreen.com/use-crossfetch-to-replace-nodefetch-and-isomorphicfetch-wbuqq.html

import 'cross-fetch/polyfill';
文章源自浅海拾贝-https://blog.terwergreen.com/use-crossfetch-to-replace-nodefetch-and-isomorphicfetch-wbuqq.html
相关文章
  • 扫码加我微信
  • 验证消息请输入:来自你的博客
  • weinxin
  • 我的微信公众号
  • 微信扫一扫与我交流吧
  • weinxin
Terwer
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: