Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dialog): useDialog's option supports zIndex #6802

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## NEXT_VERSION

### Features

- `useDialog`'s option supports `z-index`, closes [#4349](https://github.com/tusen-ai/naive-ui/issues/4349).

## 2.41.0

`2025-01-05`
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## NEXT_VERSION

### Features

- `useDialog` 的选项支持 `z-index`,关闭 [#4349](https://github.com/tusen-ai/naive-ui/issues/4349)

## 2.41.0

`2025-01-05`
Expand Down
1 change: 1 addition & 0 deletions src/dialog/demos/enUS/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ use-dialog-reactive-list.vue
| titleStyle | `Object \| string` | `undefined` | The style of the content. | 2.38.2 |
| transformOrigin | `'mouse' \| 'center'` | `'mouse'` | The transform origin of the dialog's display animation. | 2.34.0 |
| type | `'error \| 'success' \| 'warning'` | `'warning'` | Dialog type. | |
| z-index | `number` | `undefined` | Z index of the dialog. | NEXT_VERSION |
| onAfterEnter | `() => void` | `undefined` | Callback on enter animation ends. | 2.33.0 |
| onAfterLeave | `() => void` | `undefined` | Callback on leave animation ends. | 2.33.3 |
| onClose | `() => boolean \| Promise<boolean> \| any` | `undefined` | The default behavior is closing the confirm. Return `false` or resolve `false` or `Promise rejected` will prevent the default behavior. | |
Expand Down
1 change: 1 addition & 0 deletions src/dialog/demos/zhCN/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ rtl-debug.vue
| titleStyle | `Object \| string` | `undefined` | 标题的样式 | 2.38.2 |
| transformOrigin | `'mouse' \| 'center'` | `'mouse'` | 对话框动画出现的位置 | 2.34.0 |
| type | `'error \| 'success' \| 'warning'` | `'warning'` | 对话框类型 | |
| z-index | `number` | `undefined` | Dialog 的 z-index | NEXT_VERSION |
| onAfterEnter | `() => void` | `undefined` | 出现动画完成执行的回调 | 2.33.0 |
| onAfterLeave | `() => void` | `undefined` | 关闭动画完成执行的回调 | 2.33.3 |
| onClose | `() => boolean \| Promise<boolean> \| any` | `undefined` | 默认行为是关闭确认框。返回 `false` 或者 `resolve false` 或者 `Promise` 被 `reject` 会避免默认行为 | |
Expand Down
3 changes: 3 additions & 0 deletions src/dialog/src/DialogEnvironment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const exposedDialogEnvProps = {
type: Boolean,
default: true
},
zIndex: Number,
onPositiveClick: Function as PropType<
(e: MouseEvent) => Promise<unknown> | unknown
>,
Expand Down Expand Up @@ -148,6 +149,7 @@ export const NDialogEnvironment = defineComponent({
handleMaskClick,
handleEsc,
to,
zIndex,
maskClosable,
show
} = this
Expand All @@ -158,6 +160,7 @@ export const NDialogEnvironment = defineComponent({
onMaskClick={handleMaskClick}
onEsc={handleEsc}
to={to}
zIndex={zIndex}
maskClosable={maskClosable}
onAfterEnter={this.onAfterEnter}
onAfterLeave={handleAfterLeave}
Expand Down
Loading