微信小程序van-datetime-picker打开后设置默认时间如:当天

<van-field size="large" readonly bind:tap="openPicker" is-link required label="到达时间"  error-message="{{arriveTimeError}}" model:value="{{arriveTime}}" bind:focus="arriveTimeFocus" bind:blur="arriveTimeRules"></van-field>
          <van-action-sheet title="选择到达时间" show="{{ show }}" bind:close="onClose" >
            <van-datetime-picker type="datetime"  bind:cancel="onCancel"
              bind:confirm="onConfirm" value="{{currentDate}}"  />
            </van-action-sheet>
data: {
    arriveTime: '',
    currentDate:new Date().getTime()
  }
  //关键点在currentDate:new Date().getTime()
//和 van-datetime-picker 的value="{{currentDate}}"这个属性

文章来源地址https://uudwc.com/A/R63me

原文地址:https://blog.csdn.net/gaoyu007/article/details/127248094

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请联系站长进行投诉反馈,一经查实,立即删除!

上一篇 2023年09月24日 04:30
Linux 给用户 赋某个文件夹操作的权限(实现三权分立)
下一篇 2023年09月24日 04:33