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)
},
相关推荐
码云数智-园园3 小时前
小程序制作平台哪个好?微信小程序制作平台对比评测
微信小程序
毕设源码-郭学长4 小时前
【开题答辩全过程】以 基于微信小程序的当当手办店铺为例,包含答辩的问题和答案
微信小程序·小程序
qq_24218863324 小时前
微信小程序新年首页源码
微信小程序·小程序
中国胖子风清扬1 天前
GPUI 在 macOS 上编译问题排查指南
spring boot·后端·macos·小程序·rust·uni-app·web app
玛雅牛牛2 天前
多款物流信息哪款更适合
小程序
说私域2 天前
技术赋能直播运营:开源AI智能名片商城小程序助力个人IP构建与高效运营
人工智能·tcp/ip·小程序·流量运营·私域运营
说私域2 天前
流量思维向长效思维转型:开源链动2+1模式AI智能名片小程序赋能私域电商品牌建设
人工智能·小程序·开源·产品运营·私域运营
说私域3 天前
链动2+1模式AI智能名片S2B2C商城小程序在微商信任重建中的创新应用与价值实现
大数据·人工智能·小程序·私域运营
qq_24218863323 天前
微信小程序AI象棋游戏开发指南
人工智能·微信小程序·小程序
予你@。4 天前
UniApp + Vue3 实现 Tab 点击滚动定位(微信小程序)
微信小程序·小程序·uni-app