Skip to content

Button 按钮

该组件基于官方的 button 组件

参数

参数说明类型可选值默认值
size尺寸stringdefault / small / mini
type类型stringprimary / success / error / warning / info / text
plain是否朴素按钮booleanfalse
round是否圆角按钮booleanfalse
loading是否加载中booleanfalse
loading-theme加载图标主题string
loading-color加载图标颜色string
disabled是否禁用状态booleanfalse
round是否圆角boolean
border是否需要边框booleantrue
border-radius边框圆角number10
fill是否宽度填充booleanfalse
icon图标类名boolean
heightnumber64
widthnumberauto
margin外间距string, number, Array
fontSize字体大小number26
color字体颜色string
background-color背景颜色string

更多参数查阅

示例

基本用法

html
<cl-button>默认按钮</cl-button>

不同类型

html
<cl-button type="primary">主要</cl-button>
<cl-button type="success">成功</cl-button>
<cl-button type="error">错误</cl-button>
<cl-button type="warning">警告</cl-button>
<cl-button type="info">信息</cl-button>
<cl-button type="text">文本</cl-button>

不同状态

html
<cl-button type="primary" plain>朴素</cl-button>
<cl-button round>圆角</cl-button>
<cl-button loading>加载中</cl-button>
<cl-button type="primary" shadow fill>阴影</cl-button>
<cl-button type="warning" fill>填充</cl-button>

带图标

html
<cl-button icon="cl-icon-search">默认</cl-button>
<cl-button icon="cl-icon-good-fill">点赞</cl-button>