Skip to content

Commit

Permalink
feat(Calendar): props 增加 zIndex 属性透传至内部 Popup 组件 (#485)
Browse files Browse the repository at this point in the history
  • Loading branch information
sushi-su authored Mar 29, 2023
1 parent 3d4bac2 commit c2d4b95
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/vantui-doc/src/calendar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ function Demo() {
| closeOnClickOverlay | 是否在点击遮罩层后关闭 | _&nbsp;&nbsp;boolean<br/>_ | true | `false` |
| maxRange | 日期区间最多可选天数,默认无限制 | _&nbsp;&nbsp;number<br/>_ | - | `false` |
| firstDayOfWeek | 设置周起始日 | _&nbsp;&nbsp;attr:<br/>&nbsp;&nbsp;&nbsp;&nbsp;&brvbar;&nbsp;0<br/>&nbsp;&nbsp;&nbsp;&nbsp;&brvbar;&nbsp;1<br/>&nbsp;&nbsp;&nbsp;&nbsp;&brvbar;&nbsp;2<br/>&nbsp;&nbsp;&nbsp;&nbsp;&brvbar;&nbsp;3<br/>&nbsp;&nbsp;&nbsp;&nbsp;&brvbar;&nbsp;4<br/>&nbsp;&nbsp;&nbsp;&nbsp;&brvbar;&nbsp;5<br/>&nbsp;&nbsp;&nbsp;&nbsp;&brvbar;&nbsp;6<br/>_ | 0 | `false` |
| zIndex | 弹出层 zIndex | _&nbsp;&nbsp;number<br/>_ | - | `false` |
| onOpen | - | _&nbsp;&nbsp;()&nbsp;=>&nbsp;void<br/>_ | - | `false` |
| onClose | - | _&nbsp;&nbsp;()&nbsp;=>&nbsp;void<br/>_ | - | `false` |
| onOpened | - | _&nbsp;&nbsp;()&nbsp;=>&nbsp;void<br/>_ | - | `false` |
Expand Down
2 changes: 2 additions & 0 deletions packages/vantui/src/calendar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ function Index(
renderFooter,
className,
style,
zIndex,
...others
} = props

Expand Down Expand Up @@ -442,6 +443,7 @@ function Index(
onClose={onClose}
onAfterEnter={onOpened}
onAfterLeave={onClosed}
zIndex={zIndex}
>
<View
className={`van-calendar ${className || ''}`}
Expand Down
4 changes: 4 additions & 0 deletions packages/vantui/types/calendar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ export interface CalendarProps extends ViewProps {
* @default 0
*/
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6
/**
* @description 弹出层zIndex
*/
zIndex?: number
onOpen?: () => void
onClose?: () => void
onOpened?: () => void
Expand Down

0 comments on commit c2d4b95

Please sign in to comment.