Button 按钮
按钮用于触发一次即时业务操作。
基础用法
vue
<template>
<VbButton type="primary">Primary</VbButton>
<VbButton type="soft">Soft</VbButton>
<VbButton type="default">Default</VbButton>
<VbButton type="ghost">Ghost</VbButton>
<VbButton type="danger">Danger</VbButton>
</template>1
2
3
4
5
6
7
2
3
4
5
6
7
尺寸与形态
API
Props
| 属性名 | 说明 | 类型 | 默认值 |
|---|---|---|---|
type | 按钮类型 | 'primary' | 'soft' | 'default' | 'ghost' | 'success' | 'warning' | 'danger' | 'default' |
size | 按钮尺寸(默认继承 VbConfigProvider) | 'sm' | 'md' | 'lg' | 'md' |
round | 是否胶囊圆角 | boolean | false |
circle | 是否圆形按钮 | boolean | false |
block | 是否通栏占满宽度 | boolean | false |
disabled | 是否禁用 | boolean | false |
loading | 是否加载中状态 | boolean | false |
nativeType | 原生 button 的 type 属性 | 'button' | 'submit' | 'reset' | 'button' |
Events
| 事件名 | 说明 | 回调参数 |
|---|---|---|
click | 点击按钮时触发(禁用与加载态不触发) | (event: MouseEvent) => void |