Skip to content

Button 按钮

基础用法

使用type、round、circle来定义按钮样式

loading

禁用状态

使用disabled属性设置按钮禁用

loading

按钮图标

直接将图标嵌入按钮

loading

加载状态

使用loading属性使按钮变为加载状态(按钮加载时会变为禁用)

loading

改变大小

通过设置size属性来改变按钮大小

loading

回到顶部

通过 toTop 属性为按钮设置回到顶部功能, 通过绑定 target 属性可以滚动到具有指定 id 的元素顶部

loading

Button API

Button Attributes

属性名说明类型默认值
type按钮的类型'primary' | 'success' | 'warning' | 'error' | 'default'success
nativeType原生type属性'button' | 'submit' | 'reset'button
toTop是否触发回到顶部booleanfalse
target触发回到顶部的目标元素id、window或者documentstringwindow
size按钮尺寸string | 'large' | 'medium' | 'small'32
color颜色string#bebe
round圆角booleanfalse
circle圆形booleanfalse
disabled禁用booleanfalse
loading加载中booleanfalse