1、npm 安装
npm i element-ui –S
2、在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 './router' import ElementUI from 'element-ui' import 'element-ui/lib/theme-chalk/index.css' import './plugins/element.js' // 导入全局样式表 import './assets/css/global.css' Vue.config.productionTip = false Vue.use(ElementUI) new Vue({ router, render: function (h) { return h(App) } }).$mount('#app')
文章评论(0)