vantUI 日历组件van-calendar 选择了日期范围后怎么清除

img

选择了日期范围后,没有清除的api,该怎么才能清除初始化日期呢


<van-calendar
            safe-area-inset-bottom
            v-model="AlldateShow"
            type="range"
            ref="alltime"
            color="#2c79ef"
            :min-date="minDate"
          >
            <template slot="footer">
              <div class="timeTrue" @click="onConfirmAll">确定</div>
              <div class="clearTime" @click="clearTimeAll">清除时间</div>
            </template>
          </van-calendar>
clearTimeAll(){
    this.$refs.alltime.defaultDate=null
    //也可以用实例方法reset()
    this.$refs.alltime.reset(date)
}

img

那你得看 api啊 提供了这个 方法 了吗? 或者 你清空 开始事件和结束事件得 变量的值,也就是 v-model的值试试

我看了 文档 他没提供 api 那你就 复制 v-model的值 为空

赋值为初始值