下载axios npm install axios
axios前端像后台发送数据
然后再src/main.js文件夹里配置信息
// The Vue build version to load with the import
command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from ‘vue’
import App from ‘./App’
import router from ‘./router’
import axios from ‘axios’
Vue.config.productionTip = false
// 全局使用
Vue.prototype.axios = axios
/* eslint-disable no-new */
new Vue({
el: ‘#app’,
router,
components: { App },
template: ‘’
})
vue使用axios后端发送数据
最新推荐文章于 2024-04-05 19:23:35 发布