test-nut-ui
Version:
<p align="center"> <img alt="logo" src="https://img11.360buyimg.com/imagetools/jfs/t1/211965/25/7152/22022/61b16785E433119bb/aa41d7a9f7e823f3.png" width="150" style="margin-bottom: 10px;"> </p>
51 lines (50 loc) • 1.02 kB
TypeScript
import React, { FunctionComponent } from 'react';
import { BasicComponent } from '../../utils/typings';
export interface SwitchProps extends BasicComponent {
/**
* 开关状态,受控
* @default false
*/
checked: boolean
/**
* 开关状态,非受控
* @default false
*/
defaultChecked: boolean
/**
* 禁用状态
* @default false
*/
disabled: boolean
/**
* 打开时文字描述
* @default -
*/
activeText: string
/**
* 尺寸
* @default base
*/
size: 'base' | 'small'
/**
* 关闭时文字描述
* @default -
*/
inactiveText: string
/**
* loading自定义
* @default -
*/
renderLoading: () => JSX.Element
/**
* 显示loading
* @default false
*/
loading: boolean
/**
* 切换开关时触发
* @default -
*/
onChange: (val: boolean, event: React.MouseEvent) => void
}
export declare const Switch: FunctionComponent<Partial<SwitchProps>>;