https://developer.mozilla.org/zh-CN/docs/Web
web 开发网站
https://unpkg.com/axios/dist/axios.min.js
axios代码网址
fetch('./01data.json',{}) //{里面是参数}
.then(function(response){
// resolve
console.log(response); //看属性ok
return response.json();
})
.then(function(data){
console.log(data)
})
.catch(function(){
})

axios:

源码:
// 参数
// 数据获取
axios.get('./01data.json',{
Headers:{
// 请求参数格式
} ,
params:{
// 参数
id:1001
}
})
.then(function(response){
console.log(response.data);
})
.catch(function(err){
console.log(err);
})
posted on
浙公网安备 33010602011771号