安裝命令
npm install --save element-ui
可以直接復制官網的引用,復制到main.js里面;就可以忽略下面所有步驟
import Vue from 'vue'; import ElementUI from 'element-ui'; import 'element-ui/lib/theme-chalk/index.css'; import App from './App.vue'; Vue.use(ElementUI); new Vue({ el: '#app', render: h => h(App) });
找到css文件 index.css
在index.html引入這個文件 \node_modules\element-ui\lib\theme-chalk/index.css文件
把里面的fonts文件也一同引入文件夾中;
引入下面語句到main.js文件
import 'element-ui/lib/theme-chalk/index.css'; Vue.use(ElementUI);
完成可以測試使用
喜歡的小伙伴可以關注我的微信公眾號“前端偽大叔”
