fix click outside

This commit is contained in:
2023-10-23 16:08:40 +02:00
parent 9bd1ced9d4
commit a48e49ab9c
2 changed files with 35 additions and 11 deletions

View File

@@ -1,4 +1,5 @@
<script setup lang="ts">
import { vOnClickOutside } from '@vueuse/components';
import { useEventListener, useVModel } from '@vueuse/core';
import { watch } from 'vue';
@@ -37,7 +38,7 @@ useEventListener('keyup', e => {
<div class="fixed inset-0">
<div class="absolute bg-black opacity-80 inset-0 z-0" />
<div class="absolute grid inset-0">
<div class="justify-self-center m-auto">
<div class="justify-self-center m-auto" v-on-click-outside="() => isOpen = false">
<slot />
</div>
</div>