✨ feat(登录登出): 已完成用户使用账号密码登录登出

This commit is contained in:
xuan
2022-09-13 14:25:02 +08:00
parent a07ca24140
commit 5bc498ad31
14 changed files with 297 additions and 242 deletions
@@ -1,3 +1,10 @@
.checkbox {
display: flex;
align-items: center;
&--text {
margin-left: 10px;
}
}
.checkbox_main {
display: flex;
justify-content: center;
+6 -4
View File
@@ -14,9 +14,10 @@ type params = {
circle?: boolean
round?: boolean
size?: CheckboxSize
children?: React.ReactNode
}
export default forwardRef((props: params, ref) => {
const { onSelect, onClose, status = false, disabled = false, circle = false, round = true, size = 'normal' } = props
const { onSelect, onClose, status = false, disabled = false, circle = false, round = true, size = 'normal', children } = props
const [selected, SetSelected] = useState(false)
const onSelectEven = () => {
if (disabled) return false
@@ -54,12 +55,13 @@ export default forwardRef((props: params, ref) => {
SetSelected(status)
}, [status])
return (
<>
<View className={classnames(styles.checkbox_main, getMainClassName())} onClick={() => onSelectEven()}>
<View className={styles.checkbox} onClick={() => onSelectEven()}>
<View className={classnames(styles.checkbox_main, getMainClassName())}>
<View className={classnames(styles.checkbox_item, getClassName())}>
{selected && <IconFont name='icon-a-jizhumima' size={22} color='#fff'></IconFont>}
</View>
</View>
</>
{children && <View className={styles['checkbox--text']}>{children}</View>}
</View>
)
})