node+express模拟数据(三)01——main文件引入axios和server
只需安包2个
npm i axios
和
npm install express --save
main文件
import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '@/styles/index.less'
import router from '@/router'
// 简单配置axios
+ import server from '@/api'
+ Vue.prototype.$http = server
+ import axios from "axios"
Vue.config.productionTip = false
Vue.use(ElementUI)
new Vue({
router,
render: h => h(App)
}).$mount('#app')