9***@qq.com
9***@qq.com
  • 发布:2024-05-17 22:34
  • 更新:2024-05-17 22:34
  • 阅读:208

【报Bug】input绑定值为空字符,动态设置内容为数值0无效

分类:uni-app

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

PC开发环境操作系统: Windows

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

HBuilderX类型: 正式

HBuilderX版本号: 4.15

第三方开发者工具版本号: 1.06.2404301

基础库版本号: 3.4.2

项目创建方式: HBuilderX

示例代码:
<template>  
    <view>  
        <input class="uni-input" v-model="number" placeholder="自动获得焦点" />  
        Home  
        <button @click="run">Run</button>  
    </view>  
</template>  
<script>  
    export default {  
        data() {  
            return {  
                number:''  
            }  
        },  
        methods: {  
            run(){  
                //当原内容为空字符串(number:'')  
                this.number=0;//无效  

                //当原内容为非空字符串(number:'*')  
                // this.number=0;//有效  
            }  
        }  
    }  
</script>  

操作步骤:

input绑定值为空字符,动态设置内容为数值0无效

预期结果:

数值0应该显示

实际结果:

数值0不显示

bug描述:

微信平台:
当input绑定值为空字符串的时候,设置number为0无效
当input绑定值为非空字符串的时候,设置number为0有效

安卓和IOS经测试无上述问题

2024-05-17 22:34 负责人:无 分享
已邀请:

要回复问题请先登录注册