@@ -4,17 +4,13 @@ Flex Flex布局
44
55Flex 是 React Native CSS flex 布局的一个封装。
66
7- ![ ] ( https://user-images.githubusercontent.com/66067296/137708776-ad9d357f-9aad-4131-8bb1-408f4ae90a08.png ) <!-- rehype:style=zoom: 33%;float: right; margin-left: 15px;-->
8- ![ ] ( https://user-images.githubusercontent.com/66067296/137708793-79f69f8b-1d8d-4278-9aa9-6562ea6f1094.png ) <!-- rehype:style=zoom: 33%;float: right; margin-left: 15px;-->
9- ![ ] ( https://user-images.githubusercontent.com/66067296/137708799-435612a4-0139-411e-b7fa-b9f4c63be07f.png ) <!-- rehype:style=zoom: 33%;float: right; margin-left: 15px;-->
10-
117### 基础示例
128
13- ``` jsx
14- import { Fragment } from ' react' ;
9+ ``` jsx mdx:preview
10+ import React , { Fragment } from ' react' ;
1511import { Flex , Button } from ' @uiw/react-native' ;
1612
17- function Demo () {
13+ const Demo = () => {
1814 return (
1915 < Fragment>
2016 < Flex>
@@ -31,41 +27,56 @@ function Demo() {
3127 < / Fragment>
3228 );
3329}
30+
31+ export default Demo
3432```
3533
3634### 对齐方式
3735
38- ``` jsx
39- import { Fragment } from ' react' ;
40- import { Flex , Button } from ' @uiw/react-native' ;
41-
42- const Circle = (props : any ) => {
43- const size = props .size || 20 ;
44- const style = {
45- borderRadius: size / 2 ,
46- backgroundColor: ' red' ,
47- width: size,
48- height: size,
49- margin: 1 ,
50- };
51- return < View style= {style} / > ;
52- };
53-
54- function Demo () {
36+ ``` jsx mdx:preview
37+ import React ,{ Fragment } from ' react' ;
38+ import {Flex , Button , Spacing , Icon } from ' @uiw/react-native' ;
39+ import {View , Text } from ' react-native' ;
40+ const Demo = () => {
5541 return (
5642 < Fragment>
5743 < Flex justify= " start" >
58- < Circle / > < Circle / > < Circle / > < Circle / > < Circle / >
44+ < Button> 警告< / Button>
45+ < Button> 警告< / Button>
46+ < Button> 主要< / Button>
47+ < Button> 警告< / Button>
5948 < / Flex>
49+ < Spacing / >
6050 < Flex justify= " center" >
61- < Circle / > < Circle / > < Circle / > < Circle / > < Circle / >
51+ < Button color= " #fff" >
52+ < Icon name= " apple" size= {17 } / >
53+ < Text > apple< / Text >
54+ < / Button>
55+ < Button color= " #fff" >
56+ < Icon name= " menu-fold" size= {17 } / >
57+ < Text > menu- fold< / Text >
58+ < / Button>
59+ < Button color= " #ffc107" >
60+ < Icon name= " warning" size= {17 } / >
61+ < Text > warning< / Text >
62+ < / Button>
63+ < Button type= " danger" >
64+ < Icon name= " warning" fill= " #fff" size= {17 } / >
65+ < Text > warning< / Text >
66+ < / Button>
6267 < / Flex>
68+ < Spacing / >
6369 < Flex justify= " end" >
64- < Circle / > < Circle / > < Circle / > < Circle / > < Circle / >
70+ < Button> 警告< / Button>
71+ < Button> 警告< / Button>
72+ < Button> 主要< / Button>
73+ < Button> 警告< / Button>
6574 < / Flex>
6675 < / Fragment>
6776 );
6877}
78+ export default Demo
79+
6980```
7081
7182### Props
0 commit comments