
添加代码!DOCTYPE htmlhtml langzh-CNheadmeta charsetUTF-8titleVue GET 请求测试/title/headbodydiv idapph3请求结果/h3pre{{ info }}/pre/div!-- 引入 Vue 和 Axios --script srchttps://cdn.jsdelivr.net/npm/vue2.6.14/dist/vue.min.js/scriptscript srchttps://cdn.jsdelivr.net/npm/axios/dist/axios.min.js/scriptscriptnew Vue({el: #app,data: {info: null},mounted() {// 发送 GET 请求axios.get(https://jsonplaceholder.typicode.com/posts/1).then(res {console.log(请求成功, res.data);this.info res.data;}).catch(err {console.error(请求失败, err);});}});/script/body/html