@ray-js/smart-ui-typings
Version:
@ray-js/smart-ui 智能小程序 UI 框架的类型声明文件
76 lines (75 loc) • 1.5 kB
TypeScript
/// <reference types="wechat-miniprogram" />
import { VantBaseExternalClassName, VantComponent, VantEventHandler } from '../base';
export interface VantSwitchProps {
/**
* 在表单内提交时的标识符
*/
name?: string;
/**
* 开关选中状态
*
* @default false
*/
checked?: any;
/**
* 是否为加载状态
*
* @default false
*/
loading?: boolean;
/**
* 是否为禁用状态
*
* @default false
*/
disabled?: boolean;
/**
* 开关尺寸
*
* @default '30px'
*/
size?: string;
/**
* 打开时的背景色
*
* @default '#1989fa'
*/
activeColor?: string;
/**
* 关闭时的背景色
*
* @default '#fff'
*/
inactiveColor?: string;
/**
* 打开时的值
*
* @default true
*/
activeValue?: any;
/**
* 关闭时的值
*
* @default false
*/
inactiveValue?: any;
}
/**
* @deprecated
*/
export interface VantSwitchChangeEvent extends WechatMiniprogram.BaseEvent {
detail: boolean;
}
export interface VantSwitchEvents {
/**
* 开关状态切换回调
*/
onChange?: VantEventHandler<boolean>;
}
export interface VantSwitchExternalClassName extends VantBaseExternalClassName {
/**
* 圆点样式类
*/
nodeClass?: string;
}
export type VantSwitch = VantComponent<VantSwitchProps, VantSwitchEvents, VantSwitchExternalClassName>;