Skip to content

Commit

Permalink
only render the Dialog on the client
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinMalfait committed Jun 9, 2022
1 parent f2a813e commit 7c666a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/@headlessui-vue/src/components/dialog/dialog.ts
Expand Up @@ -78,10 +78,13 @@ export let Dialog = defineComponent({
},
emits: { close: (_close: boolean) => true },
setup(props, { emit, attrs, slots, expose }) {
let ready = computed(() => typeof window !== 'undefined')
let nestedDialogCount = ref(0)

let usesOpenClosedState = useOpenClosed()
let open = computed(() => {
if (ready.value === false) return false

if (props.open === Missing && usesOpenClosedState !== null) {
// Update the `open` prop based on the open closed state
return match(usesOpenClosedState.value, {
Expand Down

0 comments on commit 7c666a3

Please sign in to comment.