<!--components/timePicker/index.wxml-->
<van-popup 
  show="{{ show }}" 
  position="bottom"
  bind:close="onClose"
>

  <van-datetime-picker
    bind:confirm="onConfirm"
    bind:cancel="onCancel"
    wx:if="{{ type === 'day' }}"
    type="date"
    value="{{ day }}"
    min-date="{{ minDate }}"
    max-date="{{ maxDate }}"
    bind:input="onInput"
    formatter="{{formatter}}"
    title="日期"
  />
  <van-datetime-picker
    bind:confirm="onConfirm"
    bind:cancel="onCancel"
    wx:if="{{ type === 'month' }}"
    value="{{ month }}"
    type="year-month"
    value="{{ currentDate }}"
    min-date="{{ minDate }}"
    max-date="{{ maxDate }}"
    bind:input="onInput"
    formatter="{{formatter}}"
    title="月份"
  />
  <van-picker  
    bind:confirm="onConfirm"
    bind:cancel="onCancel"
    wx:if="{{ type === 'year' }}" 
    columns="{{ years }}" 
    bind:change="onChange" 
    title="年份"
    show-toolbar="{{true}}"
    cancel-button-text="取消"
    confirm-button-text="确定"
  />
</van-popup>
