updating how modals are done

This commit is contained in:
2022-09-01 12:49:25 -06:00
parent 2120fc8c4d
commit e5c0eae622
4 changed files with 35 additions and 66 deletions

View File

@@ -34,13 +34,6 @@ watch(() => props.show, (newShow) => {
document.body.style.overflow = null
}
})
/*watch(props.show, (newShow) => {
if (newShow) {
document.body.style.overflow = 'hidden'
} else {
document.body.style.overflow = null
}
})*/
// lifecycle hooks
onBeforeMount(() => {
@@ -53,18 +46,17 @@ onMounted(() => {
})
// methods
function close() {
const close = (() => {
if (props.closeable) {
emit('close')
}
}
})
function closeOnEscape(e) {
if (e.key === 'Escape' && props.show) {
const closeOnEscape = ((event) => {
if (event.key === 'Escape' && props.show) {
close()
}
}
})
</script>
<template>