Element-Ui组件(三)Button 按钮
element
A Vue.js 2.0 UI Toolkit for Web
项目地址:https://gitcode.com/gh_mirrors/eleme/element
·
Element-Ui组件(三)Button 按钮
本文参考Element官方文档:
基础用法
el-button经常与icon搭配使用,type属性主要用于控制其颜色,plain属性用于控制其风格,round、circle属性用于控制其形状,以下是一组增删改查的按钮示例:
<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 | 尺寸 | string | medium / small / mini | — |
| type | 类型 | string | primary / success / warning / danger / info / text | — |
| plain | 是否朴素按钮 | boolean | — | false |
| round | 是否圆角按钮 | boolean | — | false |
| circle | 是否圆形按钮 | boolean | — | false |
| loading | 是否加载中状态 | boolean | — | false |
| disabled | 是否禁用状态 | boolean | — | false |
| icon | 图标类名 | string | — | — |
| autofocus | 是否默认聚焦 | boolean | — | false |
| native-type | 原生 type 属性 | string | button / submit / reset | button |
A Vue.js 2.0 UI Toolkit for Web
最近提交(Master分支:2 个月前 )
c345bb45
1 年前
a07f3a59
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update table.md
* Update transition.md
* Update popover.md 1 年前
新一代开源开发者平台 GitCode,通过集成代码托管服务、代码仓库以及可信赖的开源组件库,让开发者可以在云端进行代码托管和开发。旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。
更多推荐


所有评论(0)