Vue中常用组件的引入
1.ElementUI
npm i element-ui -S
main.js中引入
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)
2.vue-router
npm i vue-router
main.js引入
// 引入路由
import router from './router/index.js'
new Vue({
router,
render: h => h(App),
}).$mount('#app')
3.axios
npm i vue-axios
npm i qs.js (
它的作用是能把json格式的直接转成data所需的格式)
main.js引入
import axios from 'axios'
Vue.prototype.$axios = axios