1***@163.com
1***@163.com
  • 发布:2025-08-20 12:00
  • 更新:2025-08-20 12:13
  • 阅读:32

uni-datetime-picker 点击清除按钮并不会清除绑定的值

分类:uni-app
<template>  
  <uni-datetime-picker type="daterange" :clear-icon="true" v-model="date" @change="search" />  
</template>  
<script lang='ts' setup>  
const date = ref([])  
const search = () => {  
 console.log(date.value)  
};  
//当选择好日期然后再点击清除按钮是确实出发了change事件,但是date实际还是原本选择值  
</script>
2025-08-20 12:00 负责人:无 分享
已邀请:
DCloud_UNI_JBB

DCloud_UNI_JBB

哪个端有问题,什么版本的hx

  • 1***@163.com (作者)

    微信小程序端 @dcloudio/uni-ui 1.5.11

    2025-08-20 13:43

  • 1***@163.com (作者)

    看了下源码好像是isEmitValue的判断问题

    2025-08-20 14:19

  • DCloud_UNI_JBB

    回复 1***@163.com: 确实有这个问题,我排查下,你先在change里面手动赋值一下吧

    2025-08-20 14:51

要回复问题请先登录注册