0
点赞
收藏
分享

微信扫一扫

ios微信小程序table头部与左侧固定双重滚动会抖动的坑,解决思路

快乐小鱼儿_9911 2023-12-22 阅读 48

1. 问题场景

在密码登陆时,有显示和隐藏密码的功能,实现方式很简单,直接对输入 input 的 type 进行 password 和 text 值进行切换,就可以实现密码的显示和隐藏。

2. 实现代码

  1. 通过修改 input 的 type 值实现密码的显示和隐藏。
  2. 密码的显示和隐藏控制图标也是通过 type 值进行判断显示对应图标。
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
举报

相关推荐

0 条评论