Skip to content

Commit e47d0d4

Browse files
committed
feat(popup): 添加自定义顶部
1 parent bd12ee6 commit e47d0d4

File tree

10 files changed

+12
-0
lines changed

10 files changed

+12
-0
lines changed

src/packages/popup/doc.en-US.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ import { Popup } from '@nutui/nutui-react'
9191
| minHeight | Minimum height of the popup | `string` | `26%` |
9292
| left | The left of title | `ReactNode` | `-` |
9393
| title | The center of title | `ReactNode` | `-` |
94+
| top | The top of popup | `ReactNode` | `-` |
9495
| description | The subtitle/description | `ReactNode` | `-` |
9596
| destroyOnClose | Whether to close after the component is destroyed | `boolean` | `false` |
9697
| round | Whether to show rounded corners | `boolean` | `false` |

src/packages/popup/doc.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ import { Popup } from '@nutui/nutui-react'
9191
| minHeight | 设置最小高度 | `string` | `26%` |
9292
| left | 标题左侧部分 | `ReactNode` | `-` |
9393
| title | 标题中间部分 | `ReactNode` | `-` |
94+
| top | 顶部占位 | `ReactNode` | `-` |
9495
| description | 子标题/描述部分 | `ReactNode` | `-` |
9596
| destroyOnClose | 组件不可见时,卸载内容 | `boolean` | `false` |
9697
| round | 是否显示圆角 | `boolean` | `false` |

src/packages/popup/doc.taro.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ import { Popup } from '@nutui/nutui-react-taro'
101101
| minHeight | 设置最小高度 | `string` | `26%` |
102102
| left | 标题左侧部分 | `ReactNode` | `-` |
103103
| title | 标题中间部分 | `ReactNode` | `-` |
104+
| top | 頂部佔位 | `ReactNode` | `-` |
104105
| description | 子标题/描述部分 | `ReactNode` | `-` |
105106
| destroyOnClose | 组件不可见时,卸载内容 | `boolean` | `false` |
106107
| round | 是否显示圆角 | `boolean` | `false` |

src/packages/popup/popup.taro.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export const Popup: FunctionComponent<
6969
closeIcon,
7070
left,
7171
title,
72+
top,
7273
description,
7374
style,
7475
transition,
@@ -314,6 +315,7 @@ export const Popup: FunctionComponent<
314315
onTouchEnd={handleTouchEnd}
315316
onTouchCancel={handleTouchEnd}
316317
>
318+
{top}
317319
{renderTitle()}
318320
{showChildren ? children : null}
319321
</View>

src/packages/popup/popup.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export const Popup: FunctionComponent<
6666
closeIcon,
6767
left,
6868
title,
69+
top,
6970
description,
7071
style,
7172
transition,
@@ -290,6 +291,7 @@ export const Popup: FunctionComponent<
290291
onTouchEnd={handleTouchEnd}
291292
onTouchCancel={handleTouchEnd}
292293
>
294+
{top}
293295
{renderTitle()}
294296
{showChildren && children}
295297
</div>

src/sites/sites-react/doc/docs/react/migrate-from-v2.en-US.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ If your project uses these components, please read the documentation carefully a
9898

9999
- Added the resizable property for scrolling up and down when the bottom popup is active.
100100
- Added the minHeight property for setting the minimum height, which can be used with resizable.
101+
- Added a new attribute top to display user-defined content above the title.
101102
- Added the onTouchStart, onTouchMove, and onTouchEnd methods.
102103

103104
### Layout

src/sites/sites-react/doc/docs/react/migrate-from-v2.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ plugins: [
9898

9999
- 新增属性 resizable,用于底部弹出时,可上下滑动
100100
- 新增属性 minHeight,用于设置最小高度,可搭配 resizable 使用
101+
- 新增属性 top,用于在title上侧展示用户自定义内容
101102
- 新增 onTouchStart、onTouchMove、onTouchEnd 方法
102103

103104
### 布局组件

src/sites/sites-react/doc/docs/taro/migrate-from-v2.en-US.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ If your project uses these components, please read the documentation carefully a
9898

9999
- Added the resizable property for scrolling up and down when the bottom popup is active.
100100
- Added the minHeight property for setting the minimum height, which can be used with resizable.
101+
- Added a new attribute top to display user-defined content above the title.
101102
- Added the onTouchStart, onTouchMove, and onTouchEnd methods.
102103

103104
### Layout

src/sites/sites-react/doc/docs/taro/migrate-from-v2.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ plugins: [
9898

9999
- 新增属性 resizable,用于底部弹出时,可上下滑动
100100
- 新增属性 minHeight,用于设置最小高度,可搭配 resizable 使用
101+
- 新增属性 top,用于在title上侧展示用户自定义内容
101102
- 新增 onTouchStart、onTouchMove、onTouchEnd 方法
102103

103104
### 布局组件

src/types/spec/popup/base.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export interface BasePopup extends BaseProps, BaseOverlay {
1717
closeIcon: ReactNode
1818
left?: ReactNode
1919
title?: ReactNode
20+
top?: ReactNode
2021
description?: ReactNode
2122
destroyOnClose: boolean
2223
overlay: boolean

0 commit comments

Comments
 (0)