首先在IDEA中安裝Vue插件:打開Settings...
選擇Plugins,輸入Vue,點擊install下載
打開命令端(使用Yarn命令):輸入yarn add element-ui
main.js引入ElementUI
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.config.productionTip = false
Vue.use(ElementUI);
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
render: h => h(App)
// components: { App },
// template: '<App/>'
})
測試一下:在component下的HelloWorld中添加個<el-button>按鈕
訪問http://localhost:8081/#/