前言
1.安装
npm install axios
2.在main.js中使用axios
import axios from 'axios'
// axios.defaults.baseURL = 'https://localhost:8080/'
Vue.prototype.axios = axios
3.使用
this.axios
.get('/api/test',{
params: {}
})
.then(function (response) {
console.log(JSON.stringify(response.data))
});
评论 (0)