tdesign-mobile-vue
Version:
tdesign-mobile-vue
49 lines (48 loc) • 1.6 kB
TypeScript
import { TNode } from '../common';
export interface TdInputProps {
align?: 'left' | 'center' | 'right';
allowInputOverMax?: boolean;
autocomplete?: string;
autofocus?: boolean;
borderless?: boolean;
clearTrigger?: 'always' | 'focus';
clearable?: boolean;
disabled?: boolean;
enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
format?: InputFormatType;
label?: string | TNode;
layout?: 'vertical' | 'horizontal';
maxcharacter?: number;
maxlength?: string | number;
name?: string;
placeholder?: string;
prefixIcon?: TNode;
readonly?: boolean;
spellCheck?: boolean;
status?: 'default' | 'success' | 'warning' | 'error';
suffix?: string | TNode;
suffixIcon?: TNode;
tips?: string | TNode;
type?: 'text' | 'number' | 'url' | 'tel' | 'password' | 'search' | 'submit' | 'hidden';
value?: InputValue;
defaultValue?: InputValue;
modelValue?: InputValue;
onBlur?: (value: InputValue, context: {
e: FocusEvent;
}) => void;
onChange?: (value: InputValue, context?: {
e?: InputEvent | MouseEvent | CompositionEvent;
trigger: 'input' | 'initial' | 'clear';
}) => void;
onClear?: (context: {
e: TouchEvent;
}) => void;
onFocus?: (value: InputValue, context: {
e: FocusEvent;
}) => void;
onValidate?: (context: {
error?: 'exceed-maximum' | 'below-minimum';
}) => void;
}
export declare type InputFormatType = (value: InputValue) => string;
export declare type InputValue = string | number;