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)
},
相关推荐
拖孩17 小时前
用 AI 重解千年观音灵签,做了一个微信小程序,每天摇一摇,命运给你回应
前端·后端·微信小程序
黄华SJ520it20 小时前
顶俏洗衣液模式制度开发介绍:S2B2C社交分销+多门店核销系统全解析
前端·数据库·小程序·零售·系统开发
北极糊的狐1 天前
钉钉小程序报错data.formatTime is not a function是因为 axml 模板中不能直接调用 Page 内自定义方法!
java·小程序·钉钉
java1234_小锋1 天前
【免费】微信小程序网约车(打车,在线叫车,移动出行)系统(SpringBoot4+Vue3) 锋哥原创出品,必属精品
微信小程序·网约车·在线叫车·移动出行
show4332 天前
多格式导出怎么做?2026免费小程序TXT/SRT实践
开发语言·小程序·c#
AI砖家2 天前
AI编程—微信小程序开发规范
微信小程序·小程序·notepad++·ai编程
show4332 天前
2026小程序端视频转文字技术对比:识别引擎精度实测
小程序·音视频
sam-zy3 天前
微信小程序+ESP8266+Arduino 开发智能插座,有本地OTA功能
微信小程序·小程序
A24207349303 天前
微信小程序开发:常用基础语法与指令详解
微信小程序·小程序·notepad++
黄华SJ520it3 天前
青蓝送水类型社交裂变小程序系统技术拆解
小程序·系统开发