-
首先根据官网给的安装命令安装Element-UI:
npm i element-ui -S
-
安装完毕后引入 Element
-
在 main.js 中添加/修改以下内容:
import ElementUI from 'element-ui'; import 'element-ui/lib/theme-chalk/index.css'; Vue.use(ElementUI); new Vue({ el: '#app', router, components: { App }, render: h => h(App), template: '<App/>' })
-
-
然后就可以在官网找相关组件使用就可以了
<template> <div> <el-row> <el-button>默认按钮</el-button> <el-button type="primary" v-on:click="search">主要按钮</el-button> <el-button type="success" v-on:click="search">成功按钮</el-button> <el-button type="info">信息按钮</el-button> <el-button type="warning">警告按钮</el-button> <el-button type="danger">危险按钮</el-button> </el-row> </div> </template>
-
效果
VUE中使用Element-UI
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.