1- Calendar 日历
1+ Calendar 日历
22---
33
44展示日历
55
66### 基础示例
77
8- ``` jsx mdx:preview
9- import React from ' react' ;
8+ ``` jsx mdx:preview&background=#bebebe29
9+ import React ,{ Component } from ' react' ;
1010import { View } from ' react-native' ;
1111import { Calendar } from ' @uiw/react-native' ;
1212import Layout , { Container } from ' ../Layout' ;
@@ -30,8 +30,8 @@ export default CalendarView
3030
3131### 自定义日历颜色、农历及假日展示
3232
33- ``` jsx mdx:preview
34- import React from ' react' ;
33+ ``` jsx mdx:preview&background=#bebebe29
34+ import React ,{ Component } from ' react' ;
3535import { View } from ' react-native' ;
3636import { Calendar } from ' @uiw/react-native' ;
3737import Layout , { Container } from ' ../Layout' ;
@@ -55,8 +55,8 @@ export default CalendarView
5555
5656### 自定义日历头部及农历详情展示
5757
58- ``` jsx mdx:preview
59- import React from ' react' ;
58+ ``` jsx mdx:preview&background=#bebebe29
59+ import React ,{ Component } from ' react' ;
6060import { Text , View } from ' react-native' ;
6161import { Calendar } from ' @uiw/react-native' ;
6262import Layout , { Container } from ' ../Layout' ;
@@ -66,8 +66,8 @@ function CalendarView() {
6666 const barProps = {
6767 barRightText: " 返回" ,
6868 title : " 日历" ,
69- onPressBarLeft : () => navigation .goBack (),
70- barLeftText: " 今天"
69+ onPressBarLeft : () => navigation .goBack (),
70+ barLeftText: " 今天"
7171 }
7272 return (
7373 < Container>
@@ -85,8 +85,8 @@ export default CalendarView
8585
8686### 隐藏头部
8787
88- ``` jsx mdx:preview
89- import React from ' react' ;
88+ ``` jsx mdx:preview&background=#bebebe29
89+ import React ,{ Component } from ' react' ;
9090import { View } from ' react-native' ;
9191import { Calendar } from ' @uiw/react-native' ;
9292import Layout , { Container } from ' ../Layout' ;
@@ -110,8 +110,8 @@ export default CalendarView
110110
111111### 自定义日期额外内容
112112
113- ``` jsx mdx:preview
114- import React from ' react' ;
113+ ``` jsx mdx:preview&background=#bebebe29
114+ import React ,{ Component } from ' react' ;
115115import { View ,Text } from ' react-native' ;
116116import { Calendar } from ' @uiw/react-native' ;
117117import Layout , { Container } from ' ../Layout' ;
@@ -135,8 +135,8 @@ export default CalendarView
135135
136136### 默认value值
137137
138- ``` jsx mdx:preview
139- import React ,{ useState } from ' react' ;
138+ ``` jsx mdx:preview&background=#bebebe29
139+ import React ,{Component } from ' react' ;
140140import { View ,Text } from ' react-native' ;
141141import { Calendar } from ' @uiw/react-native' ;
142142import Layout , { Container } from ' ../Layout' ;
@@ -182,4 +182,4 @@ export default CalendarView
182182| ` barLeftText ` | 导航左侧文本 | string | - |
183183| ` barRightText ` | 导航右侧文本 | string | - |
184184| ` onPressBarLeft ` | 是否显示农历及假日 | ` () => void ` | - |
185- | ` render ` | 自定义导航栏 | React.ReactNode | - |
185+ | ` render ` | 自定义导航栏 | React.ReactNode | - |
0 commit comments