1***@qq.com
1***@qq.com
  • 发布:2025-04-11 11:16
  • 更新:2025-04-14 14:03
  • 阅读:112

【报Bug】微信小程序鸿蒙系统input重大问题

分类:uni-app

产品分类: uniapp/小程序/微信

PC开发环境操作系统: Windows

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

第三方开发者工具版本号: 微信开发者工具Stable1.06.2412050

基础库版本号: 3.7.10

项目创建方式: CLI

CLI版本号: 3.0.0-4050720250324001

示例代码:

页面

<template>  
  <view>  
    <view class="pt-200px h-11000">  
      <button @click="popupRef.open()">打开</button>  
    </view>  

    <test ref="popupRef">  
      <view class="bg-#fff p-20rpx">  
        <input type="text" value="12" />  
      </view>  
    </test>  
  </view>  
</template>  
<script setup lang="ts">  
import test from "./test.vue";  

const popupRef = ref();  
</script>

子组件

<template>  
  <view class="fixed inset-0 z-9997" v-if="show">  
    <view class="fixed inset-0 z-9998 bg-(#000 opacity-40)" @click="close"> </view>  
    <view class="fixed left-0 bottom-300px w-100% z-9999">  
      <slot></slot>  
    </view>  
  </view>  
</template>  
<script setup lang="ts">  
//组件  
//方法  
//接口  
//仓库  
//  
defineOptions({  
  virtualHost: true,  
});  

const show = ref(false);  

const open = () => {  
  show.value = true;  
};  
const close = () => {  
  show.value = false;  
};  

defineExpose({  
  open,  
  close,  
});  
</script>  

<style scoped lang="scss"></style>  

操作步骤:

点击按钮,现在组件内容

预期结果:

input默认值应始终显示

实际结果:

input默认值只有首次显示,后续不显示

bug描述:

鸿蒙系统(5.0.0.150)下自定义组件传递插槽,inpout组件value值会异常,表现为默认值不显示

2025-04-11 11:16 负责人:无 分享
已邀请:
DCloud_CHB

DCloud_CHB

建议先使用微信小程序原生代码在鸿蒙手机上验证一下。

要回复问题请先登录注册