Vue前端篇(二)引進ElementUI

首先在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/#/

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章