跳转到正文

组件

日期输入框

无需日期选择器即可输入日期的掩码字段。

用法

基础

HTML
<bs:bsui-date-input placeholder="YYYY-MM-DD" />

带标签的字段

搭配标签和帮助文本,呈现真实表单中的样式。

Bookings open the day after this date.
HTML
<bs:bsui-field>
  <bs:bsui-field-label text="Start date" />
  <bs:bsui-date-input name="start_date" placeholder="Pick a start date" />
  <bs:bsui-field-description text="Bookings open the day after this date." />
</bs:bsui-field>

日期范围

两个输入框并排放置,分别使用各自的名称提交。

HTML
<bs:bsui-stack direction="row" gap="4" align="start">
  <bs:bsui-field>
    <bs:bsui-field-label text="From" />
    <bs:bsui-date-input name="from" placeholder="Check in" />
  </bs:bsui-field>
  <bs:bsui-field>
    <bs:bsui-field-label text="To" />
    <bs:bsui-date-input name="to" placeholder="Check out" />
  </bs:bsui-field>
</bs:bsui-stack>

已禁用

触发按钮和日历按钮都无法响应。

HTML
<bs:bsui-date-input placeholder="Locked until renewal" disabled="true" />

属性

属性类型默认
name text —
placeholder text Pick a date
disabled toggle false
nameAlt text —
onChange text —