uview的真机演示,微信小程序,当两个input框的时候,从一个input切换到两一个input的时候,键盘调不起来

项目场景:

项目相关背景:

例如:uview的真机演示,微信小程序,当两个input框的时候,从一个input切换到两一个input的时候,键盘调不起来

问题描述

遇到的问题:

例如:切换input框,键盘调不起来:

c 复制代码
<u-form-item prop="userName" :borderBottom="false" @click="inpuFocus('userName')">
	<u-input v-model="form.userName" :focus="inputActive == 'userName'"  @blur="inputActive = ''" placeholder="请输入用户名">
		<template slot="suffix">
			<u-icon @click="clear('userName')" v-if="form.userName" name="close-circle-fill" color="#11AC85" size="20"></u-icon>
		</template>
	</u-input>
</u-form-item>
<u-form-item prop="password" :borderBottom="false" @click="inpuFocus('password')">
	<u-input v-model="form.password" type="password" :focus="inputActive == 'password'" @blur="inputActive = ''" placeholder="请输入密码">
		<template slot="suffix">
			<u-icon @click="clear('password')" v-if="form.password" name="close-circle-fill" color="#11AC85" size="20"></u-icon>
		</template>
	</u-input>
</u-form-item>

原因分析:

问题的分析:

例如:第一次点击的时候,由于直接触发了实去焦点功能,导致clear没有清楚掉数据,但是clear方法执行了。


解决方案:

具体解决方案:延迟调用

c 复制代码
inpuFocus(data) {
	setTimeout(()=>{
		this.inputActive = data
	}, 200)
},
相关推荐
咖啡八杯18 小时前
微信小程序人脸认证1.0迁移2.0
后端·微信小程序
xshirleyl18 小时前
微信小程序开发week8-慕尚花坊项目
微信小程序·小程序
admin and root21 小时前
Claude+Trae大模型 配置Chrome MCP联动Yakit自动化渗透测试
微信小程序·渗透测试·自动化·攻防演练·ai安全·claude code·ai自动化渗透测试
code_li1 天前
小程序上线需要的资质证书汇总
小程序·上线·发布·资质
hnxaoli2 天前
统信小程序(十三)循环键鼠操作程序
python·小程序
i查拉图斯特拉如是2 天前
使用workbuddy 30分钟搭建微信小程序
微信小程序·小程序
IceSugarJJ2 天前
Open-AutoGLM项目学习
语言模型·微信小程序·github
2501_916008892 天前
Mac 上生成 AppStoreInfo.plist 文件,App Store 上架
android·macos·ios·小程序·uni-app·iphone·webview
咖啡の猫2 天前
小程序协同工作和发布
小程序
维双云2 天前
小程序怎么制作工具?与其盲目找开发,不如先分清自己要哪一种
小程序