在密码登陆时,有显示和隐藏密码的功能,实现方式很简单,直接对输入 input 的 type 进行 password 和 text 值进行切换,就可以实现密码的显示和隐藏。
import { View, Input, Image } from '@tarojs/components';
import { useAsyncState } from '@utils/event';
import licon from '@utils/icon/licon';
import api from '@utils/api';
import './index.scss';
const RuiPasswordInput = (props) => {
let {
placeholder,
value = '',
type = 'password'
} = props;
let [new_value, setnew_value] = useAsyncState(value);
let [new_type, setnew_type] = useAsyncState(type);
return <View className='rui-password-input-temp-content rui-fg rui-flex-ac'>
<View className='rui-fg rui-flex-ac'>
<Input
v