Skip to content

Commit

Permalink
fix(Notifications): teleport to body (#909)
Browse files Browse the repository at this point in the history
  • Loading branch information
arashsheyda authored Nov 3, 2023
1 parent c153138 commit 8451f4d
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/runtime/components/overlays/Notifications.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
<template>
<div :class="wrapperClass" role="region" v-bind="attrs">
<div v-if="notifications.length" :class="ui.container">
<div v-for="notification of notifications" :key="notification.id">
<UNotification
v-bind="notification"
:class="notification.click && 'cursor-pointer'"
@click="notification.click && notification.click(notification)"
@close="toast.remove(notification.id)"
>
<template v-for="(_, name) in $slots" #[name]="slotData">
<slot :name="name" v-bind="slotData" />
</template>
</UNotification>
<Teleport to="body">
<div :class="wrapperClass" role="region" v-bind="attrs">
<div v-if="notifications.length" :class="ui.container">
<div v-for="notification of notifications" :key="notification.id">
<UNotification
v-bind="notification"
:class="notification.click && 'cursor-pointer'"
@click="notification.click && notification.click(notification)"
@close="toast.remove(notification.id)"
>
<template v-for="(_, name) in $slots" #[name]="slotData">
<slot :name="name" v-bind="slotData" />
</template>
</UNotification>
</div>
</div>
</div>
</div>
</Teleport>
</template>

<script lang="ts">
Expand Down

1 comment on commit 8451f4d

@vercel
Copy link

@vercel vercel bot commented on 8451f4d Nov 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ui – ./

ui.nuxt.com
ui-nuxt-js.vercel.app
ui-git-dev-nuxt-js.vercel.app

Please sign in to comment.