<!--登录名-->
<div class="logoUser">
<image style="width:30px; height:40px;" src="file://logouserimg.png"></image>
<input type="text" class="cellInput" :placeholder="placeholderTxt" />
</div>
<!--登录名-->
<!--密码-->
<div class="logoUser">
<image style="width:30px; height:40px;" src="file://passimg2.png"></image>
<input :type="this.isPwd?'text':'password'" ref="passtext" class="cellInput" v-model="pwdStr" placeholder="请输入密码"/>
<image style="width:45px; height:20px;" :src="isshowpass" @click="showpassclick"></image>
</div>
<!--密码-->
<!--以下是脚步-->
const passIsShow = true;
showpassclick: function(e)//密码隐藏显示
{
if (passIsShow) {
this.isshowpass = 'file://noshowimg.png'
passIsShow = false;
this.isPwd=false;
}
else {
this.isshowpass = 'file://showpassimg.png'
passIsShow = true;
this.isPwd=true;
}
this.$refs['passtext'].focus();
}
只要 this.isPwd 值改变,密码input 就会失去焦点。请大神指教这个问题怎么破。