Skip to content

Time ​

概述 ​

Time是时间选择组件,继承自Input,底层使用原生时间输入,用于录入HH:mm或HH:mm:ss格式的时间。

示例 ​

声明一个时间字段只需要指定widget: 'time':

ts
const form = document.querySelector('#form');
form.state = {
    meetingTime: configurable('14:00', {
        label: '会议时间',
        widget: 'time',
    }),
};
loading

指南 ​

基础用法 ​

ts
form.state = {
    startTime: configurable('08:30:00', {
        label: '开始时间',
        widget: 'time',
    }),
};

属性 ​

Time继承自Input的全部属性(如clearable、filled、pill等),无自有独有属性。

注意事项 ​

  • 底层基于原生<input type="time">,不同浏览器/移动端的时间选择界面存在差异,详见MDN input time。
  • Time继承自Input,icon、actions等通用属性同样可用。