tdesign-mobile-vue
Version:
tdesign-mobile-vue
14 lines (13 loc) • 452 B
TypeScript
import { ComputedRef } from 'vue';
import { TdInputProps } from '@/components';
export interface UseLengthLimitParams {
value: string;
maxlength: number;
maxcharacter: number;
allowInputOverMax: boolean;
onValidate?: TdInputProps['onValidate'];
}
export default function useLengthLimit(params: ComputedRef<UseLengthLimitParams>): {
limitNumber: ComputedRef<string>;
getValueByLimitNumber: (inputValue: string) => string;
};