forked from ant-design/ant-design-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasic.tsx
53 lines (47 loc) · 1.23 KB
/
basic.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import * as React from 'react';
import { View } from 'react-native';
import { WingBlank, WhiteSpace, Button, Progress } from 'antd-mobile';
export default class BasicProgressExample extends React.Component<any, any> {
constructor(props) {
super(props);
this.state = {
percent: 10,
};
}
onAdd = () => {
this.setState({
percent: this.state.percent + 10,
});
}
onMius = () => {
this.setState({
percent: this.state.percent - 10,
});
}
render() {
return (
<View>
<Progress percent={90} position="fixed" />
<View style={{ marginTop: 80 }}>
<Progress percent={ this.state.percent } />
</View>
<WhiteSpace/>
<WhiteSpace/>
<WingBlank style={{ marginTop: 120, flexDirection: 'row' }}>
<Button type={'default'} onPress={this.onAdd}>
+
</Button>
<Button style={{ marginLeft: 10 }} type={'default'} onPress={this.onMius}>
-
</Button>
<View style={{ flex: 1 }} />
</WingBlank>
<WhiteSpace/>
<WhiteSpace/>
<View style={{ marginTop: 80 }}>
<Progress percent={5} />
</View>
</View>
);
}
}