@tplc/wot
Version:
76 lines (75 loc) • 1.74 kB
TypeScript
import type { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue'
export type CheckShape = 'circle' | 'square' | 'button'
export declare const checkboxProps: {
customLabelClass: {
type: PropType<string>
default: string
}
customShapeClass: {
type: PropType<string>
default: string
}
/**
* 单选框选中时的值
*/
modelValue: {
type: (NumberConstructor | StringConstructor | BooleanConstructor)[]
required: boolean
default: boolean
}
/**
* 单选框形状,可选值:circle / square / button
*/
shape: {
type: PropType<CheckShape>
}
/**
* 选中的颜色
*/
checkedColor: StringConstructor
/**
* 禁用
*/
disabled: {
type: PropType<boolean | null>
default: null
}
/**
* 选中值,在 checkbox-group 中使用无效,需同 false-value 一块使用
*/
trueValue: {
type: (NumberConstructor | StringConstructor | BooleanConstructor)[]
default: boolean
}
/**
* 非选中时的值,在 checkbox-group 中使用无效,需同 true-value 一块使用
*/
falseValue: {
type: (NumberConstructor | StringConstructor | BooleanConstructor)[]
default: boolean
}
/**
* 设置大小,可选值:large
*/
size: StringConstructor
/**
* 文字位置最大宽度
*/
maxWidth: StringConstructor
customStyle: {
type: PropType<string>
default: string
}
customClass: {
type: PropType<string>
default: string
}
}
export type CheckboxProps = ExtractPropTypes<typeof checkboxProps>
export type CheckboxExpose = {
/**
* 切换当前选中状态
*/
toggle: () => void
}
export type CheckboxInstance = ComponentPublicInstance<CheckboxProps, CheckboxExpose>