-
首先根据官网给的安装命令安装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
最新推荐文章于 2024-07-02 22:39:45 发布