Skip to content
On this page

Button 按钮

Button 组件为不同使用场景提供了多种展示样式。

基本用法

<template>
    <div>
        <f-button style="margin: 5px"> 主要按钮 </f-button>
        <f-button style="margin: 5px" :type="'danger'"> 危险按钮 </f-button>
        <f-button style="margin: 5px" :type="'success'"> 成功按钮 </f-button>
        <f-button style="margin: 5px" :type="'warning'"> 警告按钮 </f-button>
        <f-button style="margin: 5px" :type="'secondary'"> 信息按钮 </f-button>
        <f-button style="margin: 5px" :type="'link'"> 文本按钮 </f-button>
    </div>
</template>

状态

尺寸

<template>
    <f-button style="margin: 5px" :size="'small'"> 小尺寸 </f-button>
    <f-button style="margin: 5px"> 默认尺寸 </f-button>
    <f-button style="margin: 5px" :size="'large'"> 大尺寸 </f-button>
</template>

类型

typescript
type ButtonType = 'primary' | 'warning' | 'danger' | 'success' | 'link' | 'secondary';
type SizeType = 'small' | 'middle' | 'large';

属性

属性名类型默认值说明
idstring--标记组件的唯一标识
typestring as ButtonType'primary'按钮显示样式
disabledbooleanfalse将按钮设置为禁用状态
sizestring as SizeType'middle'按钮尺寸

事件

事件名类型说明
clickEventEmitter<any>点击按钮事件

插槽

TIP

暂无内容