mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-21 01:02:59 +08:00
fix(components): [dialog] fix dialog not fill full screen after drag (#5875)
This commit is contained in:
parent
09ebf1bed8
commit
1d8584d627
@ -18,6 +18,7 @@ export const useDialog = (
|
||||
{ emit }: SetupContext<DialogEmits>,
|
||||
targetRef: Ref<HTMLElement | undefined>
|
||||
) => {
|
||||
let lastPosition = ''
|
||||
const visible = ref(false)
|
||||
const closed = ref(false)
|
||||
const rendered = ref(false) // when desctroyOnClose is true, we initialize it as false vise versa
|
||||
@ -158,6 +159,19 @@ export const useDialog = (
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => props.fullscreen,
|
||||
(val) => {
|
||||
if (!targetRef.value) return
|
||||
if (val) {
|
||||
lastPosition = targetRef.value.style.transform
|
||||
targetRef.value.style.transform = ''
|
||||
} else {
|
||||
targetRef.value.style.transform = lastPosition
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
if (props.modelValue) {
|
||||
visible.value = true
|
||||
|
Loading…
Reference in New Issue
Block a user