$ui/components/my-date

日期时间格式化组件

Source:

Members

(inner) dayjs :Dayjs

Source:

dayjs实例

Type:
  • Dayjs

(inner) props

Source:
Properties:
Name Type Attributes Default Description
value string | number | Date <optional>

可转换成日期时间的数据,默认当前时间

defaultValue string | number | Date <optional>

默认值, 当value无法转换成日期时间时,取该默认值,如果 defaultValue为null,显示空白

format string <optional>
YYYY-MM-DD HH:mm:ss

日期时间显示格式 对相对时间无效,支持:年Y 月M 日D 时H 分m 秒s 时区Z 上下午A

relative boolean <optional>
false

启用相对时间显示

type string <optional>

文本颜色,可选值:'primary', 'success', 'warning', 'danger', 'info'

tick boolean <optional>
false

时间按秒心跳,保持实时更新, 对相对时间无效

属性参数

(inner) slots

Source:
Properties:
Name Type Description
default string

默认插槽,自定义显示内容,参数:value 原始值,displayValue 显示值, dayjs 日期时间实例

prefix string

前缀内容

suffix string

后缀内容

插槽