updating how modals are done
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user