Vue组件中aos与fetch实现数据求方法精讲.pdfVIP

  • 3
  • 0
  • 约5.39千字
  • 约 8页
  • 2026-06-30 发布于北京
  • 举报

Vue组件中aos与fetch实现数据求方法精讲.pdf

一.Vue组件

1.aos与fetch实现数据请求(1)fetch为什么:XMLHttpRequest是一个

设计粗糙的API,配置和调用方式非常,而且基于的异步模型写起来

不友好。兼容性不好polyfill:‑ie8

==

1//获取2fetch(**).then(resres.json()).then(res{console.log(res)})

==

3fetch(**).then(resres.text()).then(res{console.log(res)})4//发送

POST请求5fetch(**,{6method:post,7headers:{8Content‑Type:

application/x‑www‑form‑urlencoded9}

文档评论(0)

1亿VIP精品文档

相关文档