Element-Ui组件(三)Button 按钮

Element-Ui组件(三)Button 按钮

本文参考Element官方文档:

http://element-cn.eleme.io/#/zh-CN/component

基础用法

el-button经常与icon搭配使用,type属性主要用于控制其颜色,plain属性用于控制其风格,roundcircle属性用于控制其形状,以下是一组增删改查的按钮示例:
在这里插入图片描述

<template>
  <div>
    <el-button icon="el-icon-circle-plus" type="primary">添加</el-button>
    <el-button round icon="el-icon-edit" type="warning">编辑</el-button>
    <el-button plain icon="el-icon-delete" type="danger">删除</el-button>
    <el-button plain round icon="el-icon-view" type="view">查看</el-button>
    <el-button circle icon="el-icon-share" type="success"></el-button>
  </div>
</template>

一组按钮也可以放到同一个组件el-button-group中:
在这里插入图片描述

<template>
  <el-button-group>
    <el-button type="primary" icon="el-icon-d-arrow-left">快退</el-button>
    <el-button type="primary" icon="el-icon-caret-right">播放</el-button>
    <el-button type="primary" icon="el-icon-d-arrow-right">快进</el-button>
    <el-button type="primary" icon="el-icon-bell">音量</el-button>
    <el-button type="primary" icon="el-icon-menu">菜单</el-button>
  </el-button-group>
</template>

el-button属性:

参数类型说明可选值默认值
size尺寸stringmedium / small / mini
type类型stringprimary / success / warning / danger / info / text
plain是否朴素按钮booleanfalse
round是否圆角按钮booleanfalse
circle是否圆形按钮booleanfalse
loading是否加载中状态booleanfalse
disabled是否禁用状态booleanfalse
icon图标类名string
autofocus是否默认聚焦booleanfalse
native-type原生 type 属性stringbutton / submit / resetbutton
  • 18
    点赞
  • 57
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值