Skip to content

Commit 1e39828

Browse files
rulishuhy
authored andcommitted
fix(Card&Calendar&CardCollapse): 修改MarkDown文档为函数
1 parent 87391b4 commit 1e39828

File tree

3 files changed

+8
-24
lines changed

3 files changed

+8
-24
lines changed

packages/core/src/Calendar/README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ import { Calendar } from '@uiw/react-native';
1212
import Layout, { Container } from '../Layout';
1313
const { Header, Body, Footer } = Layout;
1414

15-
class CalendarView extends Component {
16-
render() {
15+
function CalendarView() {
1716
const title = 'Calendar';
1817
return (
1918
<Container>
@@ -25,7 +24,6 @@ const { Header, Body, Footer } = Layout;
2524
</Layout>
2625
</Container>
2726
);
28-
}
2927
}
3028
export default CalendarView
3129
```
@@ -39,8 +37,7 @@ import { Calendar } from '@uiw/react-native';
3937
import Layout, { Container } from '../Layout';
4038
const { Header, Body, Footer } = Layout;
4139

42-
class CalendarView extends Component {
43-
render() {
40+
function CalendarView() {
4441
return (
4542
<Container>
4643
<Layout>
@@ -51,7 +48,6 @@ class CalendarView extends Component {
5148
</Layout>
5249
</Container>
5350
);
54-
}
5551
}
5652
export default CalendarView
5753

@@ -66,8 +62,7 @@ import { Calendar } from '@uiw/react-native';
6662
import Layout, { Container } from '../Layout';
6763
const { Header, Body, Footer } = Layout;
6864

69-
class CalendarView extends Component {
70-
render() {
65+
function CalendarView() {
7166
const barProps = {
7267
barRightText: "返回",
7368
title : "日历",
@@ -84,7 +79,6 @@ class CalendarView extends Component {
8479
</Layout>
8580
</Container>
8681
);
87-
}
8882
}
8983
export default CalendarView
9084
```

packages/core/src/Card/README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ Card 卡片
99
import React,{ Component } from "react"
1010
import { SafeAreaView, View, Image } from 'react-native';
1111
import Card from '@uiw/react-native/lib/Card';
12-
class Demo extends Component {
13-
render() {
12+
function Demo() {
1413
return (
1514
<SafeAreaView style={{ flex: 1 }}>
1615
<Card>
@@ -20,7 +19,6 @@ class Demo extends Component {
2019
</Card>
2120
</SafeAreaView>
2221
)
23-
}
2422
}
2523
export default Demo
2624
```
@@ -29,8 +27,7 @@ export default Demo
2927
import React,{ Component } from "react"
3028
import { SafeAreaView, View, Image } from 'react-native';
3129
import Card from '@uiw/react-native/lib/Card';
32-
class Demo extends Component {
33-
render() {
30+
function Demo() {
3431
return (
3532
<SafeAreaView style={{ flex: 1 }}>
3633
<Card borderRadius={12}>
@@ -44,7 +41,6 @@ class Demo extends Component {
4441
</Card>
4542
</SafeAreaView>
4643
)
47-
}
4844
}
4945
export default Demo
5046
```

packages/core/src/CardCollapse/README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ const contents = [
2121
'https://wx3.sinaimg.cn/mw690/4718260ely1gt2cg7t5udj23dw1wkhdu.jpg',
2222
];
2323

24-
class Demo extends Component {
25-
render() {
24+
function Demo() {
2625
const renderItem = (_, index) => {
2726
return (
2827
<View key={index} style={{ padding: 20,backgroundColor: '#fff'}}>
@@ -45,7 +44,6 @@ class Demo extends Component {
4544
</CardCollapse>
4645
</ScrollView>
4746
)
48-
}
4947
}
5048

5149
export default Demo
@@ -70,8 +68,7 @@ const contents = [
7068
'https://wx3.sinaimg.cn/mw690/4718260ely1gt2cg7t5udj23dw1wkhdu.jpg',
7169
];
7270

73-
class Demo extends Component {
74-
render() {
71+
function Demo() {
7572
const renderItem = (_, index) => {
7673
return (
7774
<View key={index} style={{ padding: 20,backgroundColor: '#fff'}}>
@@ -94,7 +91,6 @@ class Demo extends Component {
9491
</CardCollapse>
9592
</ScrollView>
9693
)
97-
}
9894
}
9995

10096
export default Demo
@@ -118,8 +114,7 @@ const contents = [
118114
'https://wx3.sinaimg.cn/mw690/4718260ely1gt2cg7t5udj23dw1wkhdu.jpg',
119115
];
120116

121-
class Demo extends Component {
122-
render() {
117+
function Demo() {
123118
const renderItem = (_, index) => {
124119
return (
125120
<View key={index} style={{ padding: 20,backgroundColor: '#fff'}}>
@@ -143,7 +138,6 @@ class Demo extends Component {
143138
</CardCollapse>
144139
</ScrollView>
145140
)
146-
}
147141
}
148142

149143
export default Demo

0 commit comments

Comments
 (0)