全
局
引
入
e
l
e
m
e
n
t
−
u
i
全局引入element-ui
全局引入element−ui
在main.js中添加
import ElementUI from 'element-ui'import'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)
示例
import Vue from 'vue'import App from './App.vue'import router from "./routes"import auth from "./utils/auth"import axios from 'axios'import ElementUI from 'element-ui'import'element-ui/lib/theme-chalk/index.css'
Vue.config.productionTip =false
// 使Mock生效
import'../mock/'
Vue.prototype.$auth= auth
Vue.prototype.$http= axios
Vue.use(ElementUI)
new Vue({
render: h => h(App),
router
}).$mount('#app')