File tree Expand file tree Collapse file tree 2 files changed +24
-23
lines changed
Expand file tree Collapse file tree 2 files changed +24
-23
lines changed Original file line number Diff line number Diff line change 1- MenuDropdown
1+ MenuDropdown 下拉菜单
22---
33
4- 菜单下拉按钮
4+ 展开式菜单
55
66
77### 基础示例
@@ -24,26 +24,7 @@ const Demo = () => {
2424
2525export default Demo ;
2626```
27- ### 按钮颜色
28-
2927
30- ``` jsx mdx:preview
31- import React , { Component } from ' react' ;
32- import { Text } from ' react-native' ;
33- import { MenuDropdown } from ' @uiw/react-native' ;
34-
35- const Demo = () => {
36- return (
37- < MenuDropdown title= " 菜单" color= " skyblue" >
38- < MenuDropdown .Item >< Text > 首页< / Text >< / MenuDropdown .Item >
39- < MenuDropdown .Item >< Text > 个人中心< / Text >< / MenuDropdown .Item >
40- < MenuDropdown .Item >< Text > 列表< / Text >< / MenuDropdown .Item >
41- < / MenuDropdown>
42- );
43- }
44-
45- export default Demo ;
46- ```
4728### 加载状态
4829
4930
@@ -126,7 +107,6 @@ export default Demo;
126107
127108### 按钮尺寸
128109
129-
130110``` jsx mdx:preview
131111import React , { Component } from ' react' ;
132112import { Text } from ' react-native' ;
@@ -203,6 +183,27 @@ const Demo = () => {
203183
204184export default Demo ;
205185```
186+
187+ ### 按钮颜色
188+
189+ ``` jsx mdx:preview
190+ import React , { Component } from ' react' ;
191+ import { Text } from ' react-native' ;
192+ import { MenuDropdown } from ' @uiw/react-native' ;
193+
194+ const Demo = () => {
195+ return (
196+ < MenuDropdown title= " 菜单" color= " skyblue" >
197+ < MenuDropdown .Item >< Text > 首页< / Text >< / MenuDropdown .Item >
198+ < MenuDropdown .Item >< Text > 个人中心< / Text >< / MenuDropdown .Item >
199+ < MenuDropdown .Item >< Text > 列表< / Text >< / MenuDropdown .Item >
200+ < / MenuDropdown>
201+ );
202+ }
203+
204+ export default Demo ;
205+ ```
206+
206207### props
207208
208209组件继承 [ ` TouchableOpacity ` ] ( https://facebook.github.io/react-native/docs/touchableopacity#docsNav )
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ export default function MenuDropdown(props: MenuDropdownProps) {
6161 } ;
6262 return (
6363 < View style = { [ styles . menuBox , { height : listHeight + 50 } ] } >
64- < Button { ...btnProps } onPress = { handleonPress } size = { size } >
64+ < Button { ...btnProps } color = { btnProps . color || '#035bb6' } onPress = { handleonPress } size = { size } >
6565 < Text > { title } </ Text >
6666 < Icon name = { btnIcon } size = { 17 } />
6767 </ Button >
You can’t perform that action at this time.
0 commit comments