@varlet/ui
Version:
A Vue3 component library based on Material Design 2 and 3, supporting mobile and desktop.
37 lines (30 loc) • 1.09 kB
TypeScript
import { BasicAttributes, ListenerProp, SetPropsDefaults, Rules as SwitchRules, VarComponent } from './varComponent'
export declare const switchProps: Record<keyof SwitchProps, any>
export type SwitchValidateTrigger = 'onChange' | 'onLazyChange'
export interface SwitchProps extends BasicAttributes {
modelValue?: any
activeValue?: any
inactiveValue?: any
disabled?: boolean
readonly?: boolean
loading?: boolean
ripple?: boolean
buttonElevation?: boolean
color?: string
loadingColor?: string
closeColor?: string
size?: string | number
lazyChange?: boolean
validateTrigger?: Array<SwitchValidateTrigger>
variant?: boolean
rules?: SwitchRules
onClick?: ListenerProp<(event: Event) => void>
onChange?: ListenerProp<(value: any) => void>
'onUpdate:modelValue'?: ListenerProp<(value: any) => void>
onBeforeChange?: ListenerProp<(value: any, change: (value: any) => void) => void>
}
export class Switch extends VarComponent {
static setPropsDefaults: SetPropsDefaults<SwitchProps>
$props: SwitchProps
}
export class _SwitchComponent extends Switch {}