let btn = document.querySelector('button')
//fetch 是原生 js 代码
//fetch 是在promise的基础上 实现的
btn.onclick = function () {
fetch('http://localhost:3000/useing/master', {
method: 'get'
})
.then(res => res.json())
.then(res => {
console.log(res);
})
}
fetch的基本用法 代码
最新推荐文章于 2025-08-28 08:30:00 发布
1206

被折叠的 条评论
为什么被折叠?



