mine-h5-ui
Version:
一款轻量级、模块化基于 Vue3.x 的 H5 前端 UI 组件库 👍
39 lines (38 loc) • 577 B
TypeScript
/**
* props rules
*/
export interface RuleItem {
type: string;
required?: boolean;
message?: string;
validator: (value: any) => boolean;
pattern: RegExp;
}
/**
* option
*/
export interface Option {
valid: boolean;
message: string;
type: string;
value: Record<string, any>;
}
/**
* emits
*/
export interface Emits {
(event: 'submit', option: Option): void;
}
/**
* props
*/
export interface Props {
/**
* 校验数据
*/
model?: Record<string, any>;
/**
* 校验规则
*/
rules?: RuleItem[];
}