微信小程序组件vant的van-datetime-picker报错

本文最后更新于 2023年6月28日 下午

微信小程序组件vant的van-datetime-picker报错
error
很多教程用的都是button,或者view,没有发生value的冲突

1
2
3
4
5
<van-cell title="发表日期" required is-link value="{{currentDate}}" bind:click="showPopup" />
<van-popup show="{{ show }}" position="bottom" custom-style="height: 50%;" bind:close="onClose">
<!-- DatetimePicker组件 -->
<van-datetime-picker type="date" :value="currentDate" bind:confirm="confirmDate" bind:cancel="cancelDate" :min-date="minDate" :max-date="maxDate" formatter="{{ formatter }}" title="选择日期" />
</van-popup>

把van-datetime-picker中的value=”“去除掉,或者是不能跟van-cell里面的value重复,猜测应该是van-datetime-picker会把返回的number类型的时间戳进行格式化,如果跟上面一样,会导致无法处理string类型的时间


微信小程序组件vant的van-datetime-picker报错
https://yuluod.github.io/2023/06/28/微信小程序组件vant的van-datetime-picker报错/
作者
yuluo
发布于
2023年6月28日
许可协议