全局引入element-ui

全 局 引 入 e l e m e n t − u i 全局引入element-ui elementui

在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')

猜你喜欢

转载自blog.csdn.net/qq_41375318/article/details/115162883