<input
type="text"
:password="showPassword"
placeholder="请输入密码至少6位"
v-model="password"
maxlength=12
class="iptPasswd"
/>
<!-- 显示或隐藏密码 -->
<view @click="showPwd">
<image :src="showPassword?'/static/login/open.png':'/static/login/close.png'" class="showPwd"></image>
</view>
showPassword: true return returns true by default
Regarding the picture may be pressed by the box and the click event will fail, you can set z-index: 999 for the picture