mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-04 20:27:44 +08:00
fix(components): [dialog] fix el-dialog z-index bug (#14373)
* Fix el-dialog z-index bug * Update packages/components/dialog/src/use-dialog.ts Co-authored-by: btea <2356281422@qq.com> * chore: lint error --------- Co-authored-by: qiang <qw13131wang@gmail.com> Co-authored-by: btea <2356281422@qq.com>
This commit is contained in:
parent
3b27db428b
commit
fd5fc8e855
@ -8,6 +8,7 @@ import {
|
||||
} from 'vue'
|
||||
import { useTimeoutFn } from '@vueuse/core'
|
||||
|
||||
import { isUndefined } from 'lodash'
|
||||
import {
|
||||
defaultNamespace,
|
||||
useId,
|
||||
@ -35,7 +36,7 @@ export const useDialog = (
|
||||
const visible = ref(false)
|
||||
const closed = ref(false)
|
||||
const rendered = ref(false) // when desctroyOnClose is true, we initialize it as false vise versa
|
||||
const zIndex = ref(props.zIndex || nextZIndex())
|
||||
const zIndex = ref(props.zIndex ?? nextZIndex())
|
||||
|
||||
let openTimer: (() => void) | undefined = undefined
|
||||
let closeTimer: (() => void) | undefined = undefined
|
||||
@ -161,7 +162,7 @@ export const useDialog = (
|
||||
closed.value = false
|
||||
open()
|
||||
rendered.value = true // enables lazy rendering
|
||||
zIndex.value = props.zIndex ? zIndex.value++ : nextZIndex()
|
||||
zIndex.value = isUndefined(props.zIndex) ? nextZIndex() : zIndex.value++
|
||||
// this.$el.addEventListener('scroll', this.updatePopper)
|
||||
nextTick(() => {
|
||||
emit('open')
|
||||
|
Loading…
Reference in New Issue
Block a user