1***@qq.com
1***@qq.com
  • 发布:2024-09-05 15:59
  • 更新:2024-09-06 09:21
  • 阅读:65

uni-datetime-picker 数据回显问题

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 19041.450

HBuilderX类型: 正式

HBuilderX版本号: 4.15

手机系统: Android

手机系统版本号: Android 12

手机厂商: 华为

手机机型: 华为meta40

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

示例代码:
<uni-datetime-picker  
            :class="modelValue !== '' ? '' : 'uni-date__x-input-placeholder'"  
            v-model="modelValue"  
            :border="false"  
            :placeholder="placeholder"  
            :disabled="disabled"  
            @blur="upwardFormChange(eventName, modelValue)"  
            @change="upwardFormChange(eventName, modelValue)"  
            :clear-icon="clearable"  
            type="datetime"  
            :hide-second="true"  
        ></uni-datetime-picker>

操作步骤:

点击日期组件在点击确定

预期结果:
<uni-datetime-picker  
            :class="modelValue !== '' ? '' : 'uni-date__x-input-placeholder'"  
            v-model="modelValue"  
            :border="false"  
            :placeholder="placeholder"  
            :disabled="disabled"  
            @blur="upwardFormChange(eventName, modelValue)"  
            @change="upwardFormChange(eventName, modelValue)"  
            :clear-icon="clearable"  
            type="datetime"  
            :hide-second="true"  
        ></uni-datetime-picker>

实际结果:
<uni-datetime-picker  
            :class="modelValue !== '' ? '' : 'uni-date__x-input-placeholder'"  
            v-model="modelValue"  
            :border="false"  
            :placeholder="placeholder"  
            :disabled="disabled"  
            @blur="upwardFormChange(eventName, modelValue)"  
            @change="upwardFormChange(eventName, modelValue)"  
            :clear-icon="clearable"  
            type="datetime"  
            :hide-second="true"  
        ></uni-datetime-picker>

bug描述:

uni-datetime-picker type设置成datetime,自己选择完不能回显时分秒,后端返回的的就能正常回显

2024-09-05 15:59 负责人:无 分享
已邀请:
DCloud_UNI_yuhe

DCloud_UNI_yuhe

你好,我看你那里有upwardFormChange,这个会有影响吗?

再看你上面有一个显示时间的地方

再有可能你看一下是不是因为宽度太短,导致没有完全加载出来。

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

    :hide-second="true" 现在只有把这个参数加上才会显示,就是不显示秒

    2024-09-05 16:49

1***@qq.com

1***@qq.com (作者)

目前是这样解决的,自己通过插槽取出来,自己来做转换

要回复问题请先登录注册