1- MaskLayer 遮罩层
1+ LoginPage 登录页
22---
33
4- 用于模态对话框,中的遮罩层。
5-
6- <!--  -->
7- <!-- rehype:style=zoom: 33%;float: right; margin-left: 15px;-->
8-
4+ 用于项目的登录页面
95### 基础示例
106
117<!-- DemoStart-->
128``` jsx mdx:preview&background=#bebebe29
13- import React , { Fragment , useState } from ' react' ;
14- import { Text , SafeAreaView } from ' react-native' ;
15- import { Button , MaskLayer , Grid , Icon } from ' @uiw/react-native' ;
9+ import React ,{ Fragment } from ' react' ;
10+ import { View } from ' react-native' ;
11+ import { LoginPage } from ' @uiw/react-native' ;
1612
1713const Demo = () => {
18- const [visible , setVisible ] = useState (false );
19- const data = Array .from (new Array (24 )).map ((_val , i ) => {
20- return { icon: < Icon name= " heart-on" color= " red" / > , text: ` ${ i} ` }
21- });
2214 return (
2315 < Fragment>
24- < MaskLayer
25- visible= {visible}
26- onDismiss= {() => {
27- setVisible (! visible);
28- }}>
29- < SafeAreaView style= {{alignItems: ' center' }}>
30- < Grid style= {{width: 500 ,heigth: 500 ,}} data= {data} columns= ' 6' hasLine= {false }/ >
31- < / SafeAreaView>
32- < / MaskLayer>
33- < Button
34- onPress= {() => {
35- setVisible (true );
36- }}>
37- {visible ? ' 隐藏模态框' : ' 显示模态框' }
38- < / Button>
16+ < View>
17+ < LoginPage / >
18+ < / View>
3919 < / Fragment>
4020 );
4121}
@@ -45,14 +25,15 @@ export default Demo
4525
4626### Props
4727
48- 继承原生 Modal 属性 [ ` ModalProps ` ] ( https://facebook.github.io/react-native/docs/modal.html#props )
49-
5028| 参数 | 说明 | 类型 | 默认值 |
5129| ------| ------| -----| ------|
52- | ` maskClosable ` | 遮罩层是否禁止点击 | ` Boolean ` | ` true ` |
53- | ` visible ` | 遮罩层是否隐藏 | ` Boolean ` | - |
54- | ` opacity ` | 遮罩层透明度 | - | 0.6 |
55- | ` onDismiss ` | 隐藏消除回调事件 | () => void | - |
56- | ` children ` | 子元素 | JSX.Element | |
30+ | ` usernamePlaceholder ` | 自定义账号输入框为空时显示的文字 | ` string ` | - |
31+ | ` inputContainerStyle ` | 自定义账号,密码,验证码输入框样式 | ` Boolean ` | - |
32+ | ` buttonStyle ` | 登录按钮自定义样式 | ` Object ` | - |
33+ | ` containerStyle ` | 登录页自定义最外层样式 | ` object ` | - |
34+ | ` buttonText ` | 登录按钮自定义文字 | ` string ` | - |
35+ | ` customContent ` | 自定义忘记密码,切换登录方式 | ` React.ReactNode ` | - |
36+ | ` onLogin ` | 登录按钮事件 | ` (username: string, password: string) => void ` | - |
37+ | ` onForgetPassword ` | 忘记密码按钮事件 | ` () => void ` | - |
5738
5839
0 commit comments