@opensig/opendesign
Version:
82 lines (81 loc) • 2.12 kB
TypeScript
import { RoundT } from '../_utils/types';
import { ExtractPropTypes, PropType } from 'vue';
export declare const SwitchSizeTypes: readonly ["medium", "small"];
export type SwitchSizeT = (typeof SwitchSizeTypes)[number];
export declare const switchProps: {
/**
* @zh-CN 双向绑定值
* @en-US Two-way binding value
*/
modelValue: {
type: (NumberConstructor | StringConstructor | BooleanConstructor)[];
default: undefined;
};
/**
* @zh-CN 非受控状态时,默认是否选中
* @en-US Default whether to select when uncontrolled
* @default false
*/
defaultChecked: {
type: BooleanConstructor;
default: boolean;
};
/**
* @zh-CN 选中状态对应值
* @en-US Value corresponding to selected state
* @default true
*/
checkedValue: {
type: (NumberConstructor | StringConstructor | BooleanConstructor)[];
default: boolean;
};
/**
* @zh-CN 未选中状态对应值
* @en-US Value corresponding to unselected state
* @default false
*/
uncheckedValue: {
type: (NumberConstructor | StringConstructor | BooleanConstructor)[];
default: boolean;
};
/**
* @zh-CN 组件尺寸
* @en-US Component size
* @default 'medium'
*/
size: {
type: PropType<SwitchSizeT>;
default: string;
};
/**
* @zh-CN 圆角大小
* @en-US Round size
*/
round: {
type: PropType<RoundT>;
};
/**
* @zh-CN 是否禁用
* @en-US Whether to disable
*/
disabled: {
type: BooleanConstructor;
default: boolean;
};
/**
* @zh-CN 是否处于加载状态
* @en-US Is loading
*/
loading: {
type: BooleanConstructor;
default: boolean;
};
/**
* @zh-CN 状态改变前的钩子函数
* @en-US Hook function before state change
*/
beforeChange: {
type: PropType<(val: boolean) => Promise<boolean> | boolean>;
};
};
export type SwitchPropsT = ExtractPropTypes<typeof switchProps>;