Skip to content

Commit

Permalink
Fix dialog maximization (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei authored Aug 27, 2024
1 parent b19cbd9 commit 6ab92f2
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/components/dialog/GlobalDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
closeOnEscape
dismissableMask
:maximizable="maximizable"
:maximized="maximized"
@hide="dialogStore.closeDialog"
@maximize="maximized = true"
@unmaximize="maximized = false"
@maximize="onMaximize"
@unmaximize="onUnmaximize"
>
<template #header>
<component
Expand All @@ -29,10 +30,19 @@ import { useDialogStore } from '@/stores/dialogStore'
import Dialog from 'primevue/dialog'
const dialogStore = useDialogStore()
const maximizable = dialogStore.props.maximizable ?? false
const maximizable = computed(() => dialogStore.props.maximizable ?? false)
const maximized = ref(false)
const onMaximize = () => {
maximized.value = true
}
const onUnmaximize = () => {
maximized.value = false
}
const contentProps = computed(() => ({
...dialogStore.props,
...(dialogStore.props.maximizable ? { maximized } : {})
maximized: maximized.value
}))
</script>

0 comments on commit 6ab92f2

Please sign in to comment.