代码

 <template>
	<view class="container">     
		<view class="pwd-view input_view">
			<input type="text" :password="showPassword" placeholder="请输入密码" value="" placeholder-class="pstyle" />
			<view @click="showPwd">查看密码</view>
		</view> 
	 </view>
 </template>
 
<script>
    export default {
        data() {
            return {
                showPassword: true
            }
        },
        methods: {
            showPwd: function() {
                this.showPassword = !this.showPassword;
            }
        }
    }
</script>
 
<style>
	input{
		font-size: 28upx;
		color: #333333;
		padding: 30upx 0;
	}

	.pwd-view{
	   width: 698upx;
		margin: 20upx auto;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
</style>

转载:uni-app input输入款点击小眼睛显示或隐藏密码_zhongli_的博客-CSDN博客

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐