let that = this
let xhr = new XMLHttpRequest()
xhr.open('GET', 'https://xxx.com/api')
xhr.responseType = 'json'
xhr.send()
xhr.onload = function () {
that.loading = false
if (xhr.status === 200) {
let resp = xhr.response
console.log(resp)
} else {
console.log('Error')
}
};
vue解决跨域最简单的办法
于 2023-09-16 00:16:29 首次发布