diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index ba3d5ba01e6..5ad5159ae7c 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -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` diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index aee800ad1d2..d71498677b0 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -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` diff --git a/src/dialog/demos/enUS/index.demo-entry.md b/src/dialog/demos/enUS/index.demo-entry.md index 7ac9f3bb7a0..56e1a398e1e 100644 --- a/src/dialog/demos/enUS/index.demo-entry.md +++ b/src/dialog/demos/enUS/index.demo-entry.md @@ -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. | | diff --git a/src/dialog/demos/zhCN/index.demo-entry.md b/src/dialog/demos/zhCN/index.demo-entry.md index a2a675f4690..68dbf95ee69 100644 --- a/src/dialog/demos/zhCN/index.demo-entry.md +++ b/src/dialog/demos/zhCN/index.demo-entry.md @@ -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` 会避免默认行为 | | diff --git a/src/dialog/src/DialogEnvironment.tsx b/src/dialog/src/DialogEnvironment.tsx index 6d049fb27f4..e7245c9938a 100644 --- a/src/dialog/src/DialogEnvironment.tsx +++ b/src/dialog/src/DialogEnvironment.tsx @@ -31,6 +31,7 @@ export const exposedDialogEnvProps = { type: Boolean, default: true }, + zIndex: Number, onPositiveClick: Function as PropType< (e: MouseEvent) => Promise<unknown> | unknown >, @@ -148,6 +149,7 @@ export const NDialogEnvironment = defineComponent({ handleMaskClick, handleEsc, to, + zIndex, maskClosable, show } = this @@ -158,6 +160,7 @@ export const NDialogEnvironment = defineComponent({ onMaskClick={handleMaskClick} onEsc={handleEsc} to={to} + zIndex={zIndex} maskClosable={maskClosable} onAfterEnter={this.onAfterEnter} onAfterLeave={handleAfterLeave}