1
- import React , { useState , useEffect } from 'react' ;
2
- import { View , Text } from 'react-native' ;
3
- import { Progress , Spacing , Button , Toast } from '@uiw/react-native' ;
4
- import Layout , { Container } from '../../Layout' ;
1
+ import React , { useState , useEffect } from 'react' ;
2
+ import { View , Text } from 'react-native' ;
3
+ import { Progress , Spacing , Button , Toast } from '@uiw/react-native' ;
4
+ import Layout , { Container } from '../../Layout' ;
5
5
6
- const { Header, Body, Card } = Layout ;
6
+ const { Header, Body, Card} = Layout ;
7
7
8
8
const ProgressDemo = ( props : any ) => {
9
- const { route } = props ;
9
+ const { route} = props ;
10
10
const description = route . params . description ;
11
11
const title = route . params . title ;
12
12
@@ -17,84 +17,79 @@ const ProgressDemo = (props: any) => {
17
17
if ( val < 100 ) {
18
18
setValue ( val + 5 ) ;
19
19
} else {
20
- Toast . info ( '宝,别点了,要溢出了' )
20
+ Toast . info ( '宝,别点了,要溢出了' ) ;
21
21
}
22
22
} ;
23
23
24
24
return (
25
25
< Container >
26
26
< Header title = { title } description = { description } />
27
- < Body style = { { paddingLeft : 16 , paddingRight : 16 } } >
27
+ < Body style = { { paddingLeft : 16 , paddingRight : 16 } } >
28
28
< Card title = "基础实例" >
29
- < Progress type = ' circle' value = { 60 } />
29
+ < Progress type = " circle" value = { 60 } />
30
30
< Spacing />
31
- < Progress type = ' line' value = { 60 } />
31
+ < Progress type = " line" value = { 60 } />
32
32
</ Card >
33
33
< Card title = "自定义值" >
34
- < Progress type = ' circle' value = { val } />
34
+ < Progress type = " circle" value = { val } />
35
35
< Spacing />
36
- < Progress type = ' line' value = { val } />
36
+ < Progress type = " line" value = { val } />
37
37
< Spacing />
38
- < Button onPress = { ( ) => onPress ( ) } > 你点我呀!</ Button >
38
+ < Button onPress = { ( ) => onPress ( ) } > 你点我呀!</ Button >
39
39
</ Card >
40
40
< Card title = "自定义渐变色" >
41
- < Progress type = ' circle' color = { [ '#FFD080' , 'red' ] } value = { 80 } />
41
+ < Progress type = " circle" color = { [ '#FFD080' , 'red' ] } value = { 80 } />
42
42
< Spacing />
43
- < Progress type = ' line' color = { [ 'red' , '#FFD080' , ] } value = { 80 } />
43
+ < Progress type = " line" color = { [ 'red' , '#FFD080' ] } value = { 80 } />
44
44
</ Card >
45
45
< Card title = "设置大小" >
46
- < Progress type = ' circle' width = { 60 } left = ' 6.5%' value = { 10 } />
46
+ < Progress type = " circle" width = { 60 } left = " 6.5%" value = { 10 } />
47
47
< Spacing />
48
- < Progress type = ' circle' width = { 80 } left = ' 8.5%' value = { 20 } />
48
+ < Progress type = " circle" width = { 80 } left = " 8.5%" value = { 20 } />
49
49
< Spacing />
50
- < Progress type = ' line' width = { 60 } value = { 40 } />
50
+ < Progress type = " line" width = { 60 } value = { 40 } />
51
51
< Spacing />
52
- < Progress type = ' line' width = { 80 } value = { 60 } />
52
+ < Progress type = " line" width = { 80 } value = { 60 } />
53
53
</ Card >
54
54
< Card title = "是否显示单位" >
55
- < Progress type = ' circle' showUnit = { false } left = ' 13%' value = { 20 } />
55
+ < Progress type = " circle" showUnit = { false } left = " 13%" value = { 20 } />
56
56
< Spacing />
57
- < Progress type = ' line' showUnit = { false } value = { 40 } />
57
+ < Progress type = " line" showUnit = { false } value = { 40 } />
58
58
</ Card >
59
59
< Card title = "自定义单色" >
60
- < Progress type = ' circle' color = ' #FFD080' value = { 50 } />
60
+ < Progress type = " circle" color = " #FFD080" value = { 50 } />
61
61
< Spacing />
62
- < Progress type = ' line' color = ' #FFD080' value = { 60 } />
62
+ < Progress type = " line" color = " #FFD080" value = { 60 } />
63
63
</ Card >
64
64
< Card title = "自定义背景色" >
65
- < Progress type = ' circle' bgColor = "#FFD080" value = { 5 } />
65
+ < Progress type = " circle" bgColor = "#FFD080" value = { 5 } />
66
66
< Spacing />
67
- < Progress type = ' line' bgColor = ' #FFD080' value = { 70 } />
67
+ < Progress type = " line" bgColor = " #FFD080" value = { 70 } />
68
68
</ Card >
69
69
< Card title = "设置外环宽度" >
70
- < Progress type = ' circle' value = { 5 } strokeWidth = { 25 } />
70
+ < Progress type = " circle" value = { 5 } strokeWidth = { 25 } />
71
71
< Spacing />
72
- < Progress type = ' line' value = { 70 } strokeWidth = { 15 } />
72
+ < Progress type = " line" value = { 70 } strokeWidth = { 15 } />
73
73
</ Card >
74
74
75
75
< Card title = "是否显示文本" >
76
- < Progress type = ' circle' value = { 68 } showLabel = { false } />
76
+ < Progress type = " circle" value = { 68 } showLabel = { false } />
77
77
< Spacing />
78
- < Progress type = ' line' value = { 70 } showLabel = { false } />
78
+ < Progress type = " line" value = { 70 } showLabel = { false } />
79
79
</ Card >
80
80
< Card title = "自定义标签" >
81
- < Progress type = ' circle' value = { 53 } label = { < Text > 饕餮</ Text > } />
81
+ < Progress type = " circle" value = { 53 } label = { < Text > 饕餮</ Text > } />
82
82
< Spacing />
83
- < Progress type = 'line' value = { 30 } label = { < Text > 饕餮</ Text > } />
84
- </ Card >
85
- < Card title = "设置外环宽度" >
86
- < Progress type = 'circle' value = { 5 } strokeWidth = { 25 } />
87
- < Spacing />
88
- < Progress type = 'line' value = { 70 } strokeWidth = { 15 } />
83
+ < Progress type = "line" value = { 30 } label = { < Text > 饕餮</ Text > } />
89
84
</ Card >
90
85
< Card title = "自定义文本位置" >
91
- < Progress type = ' circle' value = { 5 } top = "50%" left = ' 50%' />
86
+ < Progress type = " circle" value = { 5 } top = "50%" left = " 50%" />
92
87
< Spacing />
93
- < Progress type = ' line' value = { 70 } top = "-20%" left = ' 50%' />
88
+ < Progress type = " line" value = { 70 } top = "-20%" left = " 50%" />
94
89
</ Card >
95
90
< Spacing />
96
91
</ Body >
97
- </ Container >
92
+ </ Container >
98
93
) ;
99
94
} ;
100
95
0 commit comments