Vue练手项目(三):使用Element UI

1.安装Element UI框架

安装后 , 可在node_modules目录下看到element-ui文件

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

+ [email protected]
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: ''
})

element-ui文档地址

你可能感兴趣的:(Vue练手项目(三):使用Element UI)