uni-app u-view中 u--input 切换type时,input框内有数据时光标bug
uni-app u-view中 u–input 切换type时,input框内有数据时光标bug
开发环境 | 版本号 | 项目创建方式 |
---|---|---|
PC | Windows 10 1909 | CLI 2 |
示例代码:
<template> <view class="content"> <text>密码:</text> <u--input ref="passwordRef" v-model="password" placeholder="请输入密码" clearable :type="type" border="bottom" > <template slot="suffix"> <u-icon name="eye" size="40" v-if="isPassword" @click="changeShowPwd" /> <u-icon name="eye-fill" size="40" v-if="!isPassword" @click="changeShowPwd" /> </template> </u--input> </view> </template> <script> export default { data() { return { password: '' ,// 密码 isPassword: true, //密码是否显示 type:"password" } }, mounted() {}, methods: { changeShowPwd() { this.isPassword = !this.isPassword if(this.isPassword){ this.type="text" }else{ this.type="password" } console.log(this.type,'type') } } } </script> <style lang="scss" scoped> // ROOT .login-root-view { flex: 1; .content { flex: 1; flex-direction: row; padding: 0 50rpx 0 40rpx; } </style>
4 回复
演示视频
上传完整的可以复现的demo,方便排查,u–input哪里来的
···
①附件文件是示例文件(整个项目),下载的是uniapp官方的示例文件
②demo在文件的路径 pages/tabBar/component/component (用自定义基座,安卓模拟器打开后是首页)
③ u–input来源是 uView 这个UI框架
···