sard-uniapp
Version:
sard-uniapp 是一套基于 Uniapp + Vue3 框架开发的兼容多端的 UI 组件库
178 lines (177 loc) • 5.43 kB
TypeScript
import { type StyleValue } from 'vue';
export interface SwitchProps {
rootStyle?: StyleValue;
rootClass?: string;
modelValue?: any;
disabled?: boolean;
readonly?: boolean;
loading?: boolean;
size?: string;
checkedColor?: string;
uncheckedColor?: string;
checkedValue?: any;
uncheckedValue?: any;
beforeUpdate?: (value: any) => Promise<any>;
validateEvent?: boolean;
}
export declare const defaultSwitchProps: {
rootStyle?: (string | false | ((props: {
rootStyle: StyleValue;
rootClass: string;
modelValue: any;
disabled: boolean;
readonly: boolean;
loading: boolean;
size: string;
checkedColor: string;
uncheckedColor: string;
checkedValue: any;
uncheckedValue: any;
beforeUpdate: (value: any) => Promise<any>;
validateEvent: boolean;
}) => string | false | import("vue").CSSProperties | StyleValue[]) | null) | undefined;
rootClass?: (string | ((props: {
rootStyle: StyleValue;
rootClass: string;
modelValue: any;
disabled: boolean;
readonly: boolean;
loading: boolean;
size: string;
checkedColor: string;
uncheckedColor: string;
checkedValue: any;
uncheckedValue: any;
beforeUpdate: (value: any) => Promise<any>;
validateEvent: boolean;
}) => string)) | undefined;
modelValue?: any;
disabled?: (boolean | ((props: {
rootStyle: StyleValue;
rootClass: string;
modelValue: any;
disabled: boolean;
readonly: boolean;
loading: boolean;
size: string;
checkedColor: string;
uncheckedColor: string;
checkedValue: any;
uncheckedValue: any;
beforeUpdate: (value: any) => Promise<any>;
validateEvent: boolean;
}) => boolean)) | undefined;
readonly?: (boolean | ((props: {
rootStyle: StyleValue;
rootClass: string;
modelValue: any;
disabled: boolean;
readonly: boolean;
loading: boolean;
size: string;
checkedColor: string;
uncheckedColor: string;
checkedValue: any;
uncheckedValue: any;
beforeUpdate: (value: any) => Promise<any>;
validateEvent: boolean;
}) => boolean)) | undefined;
loading?: (boolean | ((props: {
rootStyle: StyleValue;
rootClass: string;
modelValue: any;
disabled: boolean;
readonly: boolean;
loading: boolean;
size: string;
checkedColor: string;
uncheckedColor: string;
checkedValue: any;
uncheckedValue: any;
beforeUpdate: (value: any) => Promise<any>;
validateEvent: boolean;
}) => boolean)) | undefined;
size?: (string | ((props: {
rootStyle: StyleValue;
rootClass: string;
modelValue: any;
disabled: boolean;
readonly: boolean;
loading: boolean;
size: string;
checkedColor: string;
uncheckedColor: string;
checkedValue: any;
uncheckedValue: any;
beforeUpdate: (value: any) => Promise<any>;
validateEvent: boolean;
}) => string)) | undefined;
checkedColor?: (string | ((props: {
rootStyle: StyleValue;
rootClass: string;
modelValue: any;
disabled: boolean;
readonly: boolean;
loading: boolean;
size: string;
checkedColor: string;
uncheckedColor: string;
checkedValue: any;
uncheckedValue: any;
beforeUpdate: (value: any) => Promise<any>;
validateEvent: boolean;
}) => string)) | undefined;
uncheckedColor?: (string | ((props: {
rootStyle: StyleValue;
rootClass: string;
modelValue: any;
disabled: boolean;
readonly: boolean;
loading: boolean;
size: string;
checkedColor: string;
uncheckedColor: string;
checkedValue: any;
uncheckedValue: any;
beforeUpdate: (value: any) => Promise<any>;
validateEvent: boolean;
}) => string)) | undefined;
checkedValue?: any;
uncheckedValue?: any;
beforeUpdate?: (((value: any) => Promise<any>) | ((props: {
rootStyle: StyleValue;
rootClass: string;
modelValue: any;
disabled: boolean;
readonly: boolean;
loading: boolean;
size: string;
checkedColor: string;
uncheckedColor: string;
checkedValue: any;
uncheckedValue: any;
beforeUpdate: (value: any) => Promise<any>;
validateEvent: boolean;
}) => (value: any) => Promise<any>)) | undefined;
validateEvent?: (boolean | ((props: {
rootStyle: StyleValue;
rootClass: string;
modelValue: any;
disabled: boolean;
readonly: boolean;
loading: boolean;
size: string;
checkedColor: string;
uncheckedColor: string;
checkedValue: any;
uncheckedValue: any;
beforeUpdate: (value: any) => Promise<any>;
validateEvent: boolean;
}) => boolean)) | undefined;
};
export interface SwitchEmits {
(e: 'click', event: any): void;
(e: 'update:model-value', value: any): void;
(e: 'change', value: any): void;
(e: 'update:loading', loading: boolean): void;
}