Element UI之Button 按钮

Button 按钮

常用的操作按钮。

按需引入方式

如果是完整引入可跳过此步骤

javascript 复制代码
import Vue from 'vue'
import { Button } from 'element-ui'
import 'element-ui/lib/theme-chalk/base.css'
import 'element-ui/lib/theme-chalk/button.css'
import 'element-ui/lib/theme-chalk/icon.css'

Vue.use(Button)

基础用法

vue 复制代码
<template>
    <el-button>默认按钮</el-button>
</template>

禁用状态

vue 复制代码
<template>
    <el-button disabled></el-button>
</template>

不同颜色

vue 复制代码
<template>
    <el-button>默认按钮</el-button>
    <el-button type="primary">主要按钮</el-button>
    <el-button type="success">成功按钮</el-button>
    <el-button type="info">信息按钮</el-button>
    <el-button type="warning">警告按钮</el-button>
    <el-button type="danger">危险按钮</el-button>
</template>

不同形状

vue 复制代码
<template>
    <el-button>默认按钮</el-button>
    <el-button plain>朴素按钮</el-button>
    <el-button round>圆角按钮</el-button>
    <el-button icon="el-icon-search" circle></el-button>
</template>

不同尺寸

:::warning 注意

由于预览模式是由 Element Plus 进行模拟的,在新版中已经改为了三种尺寸的按钮。而旧版中存在四种尺寸按钮。

:::

vue 复制代码
<template>
    <el-button>默认按钮</el-button>
    <el-button size="medium">中等按钮</el-button>
    <el-button size="small">小型按钮</el-button>
    <el-button size="mini">超小按钮</el-button>
</template>

Attributes

参数 说明 类型 默认值
size 按钮尺寸 string
type 按钮颜色 string
plain 是否朴素按钮 boolean false
round 是否圆角按钮 boolean false
circle 是否圆形按钮 boolean false
disabled 是否禁用状态 boolean false
icon 图标类名 string
...

原文链接:菜园前端

相关推荐
打瞌睡的朱尤6 小时前
Vue day10 完整购物网页(登录页,首页,搜索)
前端·javascript·vue.js
扶苏10027 小时前
深入理解 Vue 3 的 watchEffect
前端·javascript·vue.js
未来龙皇小蓝9 小时前
RBAC前端架构-05:引入Element-UI及相关逻辑
前端·ui
yanlele9 小时前
AI Coding 时代下, 关于你会写代码这件事儿, 还重要吗?
前端·javascript·ai编程
打瞌睡的朱尤10 小时前
Vue day9 购物车,项目,vant组件库,vw,路由
前端·javascript·vue.js
星火开发设计12 小时前
模板参数:类型参数与非类型参数的区别
java·开发语言·前端·数据库·c++·算法
cc.ChenLy14 小时前
【CSS进阶】毛玻璃效果与代码解析
前端·javascript·css
何中应14 小时前
使用Jenkins部署前端项目(Vue)
前端·vue.js·jenkins
西门吹-禅14 小时前
node js 性能处理
开发语言·javascript·ecmascript
工控小龙人14 小时前
船舶维修HMI:船舶发动机的检修诊断界面
ui·人机交互·用户界面