准时下班
准时下班
  • 发布:2022-11-16 10:31
  • 更新:2022-11-16 10:31
  • 阅读:143

input不同版本编译器出现不同程度的bug

分类:uni-app

这是我创建的一个简单的案例,出现的具体问题如下:
1.当我在index页面通过uni.reLaunch跳转页面时,使用HBuilder 3.4.7,云打包出现跳转页面后无法将光标默认赋到输入框1,回车后正常切换光标位置,使用HBuilder 3.6.4,云打包跳转页面后光标默认出现在输入框1,但输入值后,回车光标先从输入框1跳到输入框2,在将输入框1的内容全选中。这种现象只出现打包后,使用网页或者真机调试,模拟器调试等都不出现此类问题,使用最新的HBuilderX.3.6.9.20221114-alpha与离线打包3.6.9版本依然无法解决这个问题

#页面一  
<template>  
    <view class="content">  
        <view class="text-area">  
            <button class="but" @tap="top">登录</button>  
        </view>  
    </view>  
</template>  

<script>  
    export default {  
        data() {  
            return {  
                title: '登录'  
            }  
        },  
        onLoad() {  

        },  
        methods: {  
            top(){  
                // uni.redirectTo({  
                //  url:"/pages/user/user"  
                // })  
                uni.reLaunch({  
                    url:"/pages/user/user"  
                })  
            }  
        }  
    }  
</script>  
#页面二  
<template>  
    <view>  
        <input @input="theBlur" class="css_input" :focus="isfocus" @blur="isblur" @confirm="con" type="text" :value="inp1" placeholder="输入框1"/>  
        <input @input="theBlur1" class="css_input" :focus="isfocus1" @blur="isblur1" @confirm="con1" type="text" :value="inp2" placeholder="输入框2"/>  
        <button @tap="btn">退出登录</button>  
        <button @tap="btn1">重置</button>  
    </view>  
</template>  

<script>  
    export default {  
        data() {  
            return {  
                isfocus:true,  
                isfocus1:false,  
                inp1:'',  
                inp2:''  
            }  
        },  
        onLoad(){  
            var that=this  
            that.isfocus=true  
        },  
        onShow(){  

        },  
        methods: {  
            theBlur(e){  
                this.inp1= e.detail.value;  
            },  
            theBlur1(e){  
                this.inp2= e.detail.value;  
            },  
            isblur(){  
                this.isfocus=false  
            },  
            isblur1(){  
                this.isfocus1=false  
            },  
            con(){  
                this.isfocus1=true  
            },  
            con1(){  
                this.isfocus=true  
            },  
            btn(){  
                uni.redirectTo({  
                    url:"../index/index"  
                })  
            },  
            btn1(){  
                var that = this  
                that.inp1=''  
                that.inp2=''  
                that.isfocus=true  
            }  
        }  
    }  
</script>  

<style>  
    .css_input{  
        width: 50%;  
        height: 30px;  
        line-height: 30px;  
        border: 1px solid royalblue;  
        margin-top: 20px;  
        margin: 30px;  
    }  
</style>  
2022-11-16 10:31 负责人:DCloud_Android_ST 分享
已邀请:

要回复问题请先登录注册