(不难但存档)--动态改动type类型导致样式失效
<view class="phone" style="margin-top: 30rpx;">
<!-- <image src="/static/login/loginicon04.png" class="loginicon" style="width: 50rpx;height: 50rpx;">
</image> -->
<uni-icons type="eye-slash" size="25" @click="password='text'" v-if="password==='password'" color="#dae0e1" class="loginicon"></uni-icons>
<uni-icons type="eye" size="25" @click="password='password'" v-if="password==='text'" color="#dae0e1" class="loginicon"></uni-icons>
<input style="width: 70%;" type="password" v-model="account.password" class="input pwd-input" placeholder="请输入密码" v-if="password==='password'"
placeholder-style="color:#adc9d8;" />
<input style="width: 70%;" type="text" v-model="account.password" class="input pwd-input" placeholder="请输入密码" v-if="password==='text'"
placeholder-style="color:#adc9d8;" />
<image src="/static/login/loginicon03.png" class="guanbi" style="margin-left: auto;margin-right: 30rpx;"
v-if="account.password" @click="account.password=''"></image>
</view>
</view>
account: {
code: '',
username: '',
password: ''
},
.phone {
width: 630rpx;
margin: 0 auto;
border: 1px solid #dae0e1;
border-radius: 5rpx;
height: 100rpx;
display: flex;
align-items: center;.code {
color: #adc9d8;
font-size: 34rpx;
margin-left: auto;
margin-right: 30rpx;
}.guanbi {
width: 40rpx;
height: 40rpx;
}.input {
flex: 1;
height: 100%;
color: #333;
font-size: 34rpx;
margin-left: 30rpx;
// background: #f3f3f3;
// border: 1rpx solid #dae0e1;
// box-sizing: border-box;
// border-right: none;
// border-left: none;
}
.loginicon {
width: 45rpx;
height: 45rpx;
margin-left: 35rpx;
}
}