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/>'
})