Skip to content

Commit

Permalink
Merge branch 'main' of github.com:fumeapp/tailvue
Browse files Browse the repository at this point in the history
  • Loading branch information
acidjazz committed Jun 17, 2022
2 parents 8a0000d + f86c47a commit a94fd98
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ModalBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

<script lang="ts" setup>
import { onMounted, ref } from 'vue'
import { onKeyStroke } from '@vueuse/core'
import { Icon } from '@iconify/vue'
const props = defineProps({
Expand All @@ -62,6 +63,10 @@ const props = defineProps({
})
const active = ref(false)
onMounted(() => active.value = true)
onKeyStroke('Escape', (e: KeyboardEvent) => {
e.preventDefault()
destroy()
})
async function destroy() {
active.value = false
setTimeout(() => props.destroyed(), 200)
Expand Down

0 comments on commit a94fd98

Please sign in to comment.