Vue練手項(xiàng)目(三):使用Element UI

1.安裝Element UI框架

安裝后 , 可在node_modules目錄下看到element-ui文件

admin_web>npm install element-ui -S
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ element-ui@2.4.11
added 6 packages in 16.659s

2.Vue中使用Element UI

修改\src\main.js , 在main.js中引用element-ui

import Vue from 'vue'
import ElementUI from 'element-ui'#引入element-ui
import App from './App'
import router from './router'

Vue.config.productionTip = false

Vue.use(ElementUI)#使用element-ui
import 'element-ui/lib/theme-chalk/index.css'#引入樣式文件

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})

element-ui文檔地址

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容