jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
38 lines (37 loc) • 922 B
TypeScript
import type { BaseSchema, StaticControlSchemaBase } from '../types';
/**
* Date 展示渲染器。
*/
export interface DateSchema extends BaseSchema {
/**
* 指定为日期展示类型
*/
type: 'date' | 'datetime' | 'time' | 'month';
/**
* 默认值
*/
value?: any;
/**
* 展示的时间格式,参考 moment 中的格式说明。
*/
format?: string;
/**
* 占位符
*/
placeholder?: string;
/**
* 值的时间格式,参考 moment 中的格式说明。
*/
valueFormat?: string;
/**
* 显示成相对时间,比如1分钟前
*/
fromNow?: boolean;
/**
* 更新频率, 默认为1分钟
*/
updateFrequency?: number;
}
export interface StaticDateSchema extends Omit<DateSchema, 'type'>, StaticControlSchemaBase {
type: 'static-date' | 'static-datetime' | 'static-time' | 'static-month';
}