@cainiaofe/cn-ui-m
Version:
62 lines (61 loc) • 1.41 kB
TypeScript
import { BasicComponentProps } from "../../../types";
import * as React from 'react';
import type { CnButtonType } from './cn-button-type';
export interface CnButtonProps extends BasicComponentProps {
/**
* 按钮的类型
*/
type?: CnButtonType;
/**
* 按钮尺寸
*/
size?: 'small' | 'medium' | 'large';
/**
* 按钮是否占满一行
*/
fullWidth?: boolean;
/**
* 组件的HTML标签名称
*/
component?: 'button' | 'a' | 'div' | 'span';
/**
* 当 component = 'button' 时,设置 button 标签的 type 值
*/
htmlType?: 'submit' | 'reset' | 'button';
/**
* 当 component = 'a' 时,设置 a 标签的跳转链接
*/
href?: string;
/**
* 当 component = 'a' 时,设置 a 标签的链接打开位置
*/
target?: string;
/**
* 是否加载态(loading 效果)
*/
loading?: boolean;
/**
* loading根据异步状态自动切换
*/
asyncLoading?: boolean;
/**
* 是否是告警模式
*/
warning?: boolean;
/**
* 是否为文本按钮
*/
text?: boolean;
/**
* 是否为反白按钮
*/
inverse?: boolean;
/**
* 是否禁用
*/
disabled?: boolean;
/**
* 按钮被点击时回调
*/
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => any;
}