Add teleport to Modals.
This commit is contained in:
parent
f823e599b4
commit
42d0fe483e
1 changed files with 16 additions and 14 deletions
|
|
@ -1,18 +1,20 @@
|
||||||
<template>
|
<template>
|
||||||
<transition name="fade" @after-enter="content = true">
|
<teleport to="body">
|
||||||
<div
|
<transition name="fade" @after-enter="content = true">
|
||||||
v-if="show"
|
<div
|
||||||
class="modal-container"
|
v-if="show"
|
||||||
:class="closable ? 'clickable' : ''"
|
class="modal-container"
|
||||||
@click.self.stop="handleBackgroundClick"
|
:class="closable ? 'clickable' : ''"
|
||||||
>
|
@click.self.stop="handleBackgroundClick"
|
||||||
<transition name="burst" @after-leave="$emit('closed')">
|
>
|
||||||
<div v-if="content" class="modal unclickable">
|
<transition name="burst" @after-leave="$emit('closed')">
|
||||||
<slot />
|
<div v-if="content" class="modal unclickable">
|
||||||
</div>
|
<slot />
|
||||||
</transition>
|
</div>
|
||||||
</div>
|
</transition>
|
||||||
</transition>
|
</div>
|
||||||
|
</transition>
|
||||||
|
</teleport>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue