参考2篇博客
1-VUE、C++前后端调用
2-Vue解决CORS header ‘Access-Control-Allow-Origin’ missing及同源、跨域问题
这里给出App.vue代码
<script setup lang="ts">
import HelloWorld from './components/HelloWorld.vue'
import axios from 'axios'
import {
ref } from 'vue'
const backendResponse = ref("bbbb")
const callBackend = () => {
axios.get('http://localhost:8080/api/hello')
.then(function(response){
console.log("check msg");
console.log(response.data);
backendResponse.value = response.data
})
.catch(error => {
console.


1319

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



