1.首先我們需要在命令行工具安裝element-ui
命令:npm install element-ui
image.png
等到顯示上圖所示,即為安裝成功肮雨,那么我們?nèi)绾卧趘ue項(xiàng)目中使用它呢?
2.安裝后我們應(yīng)先在main.js中引入element相關(guān)的內(nèi)容
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)
3.在.vue文件中加入element-ui的按鈕之類的即可遵堵。
<template>
<div id="app">
<img src="./assets/logo.png">
<router-view/>
<el-button type="primary">主要按鈕</el-button>
</div>
</template>
<script>
export default {
name: 'app'
}
</script>
<style scoped>
@import '../static/css/index.css';
</style>
運(yùn)行效果如下圖所示
image.png
詳細(xì)對(duì)于element-ui組件的使用請(qǐng)參照
element官網(wǎng)