mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
close when clicking outside
This commit is contained in:
parent
5c2229c714
commit
bece257c80
1 changed files with 5 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="modal">
|
<div class="modal">
|
||||||
<div>
|
<div @click="handleClick">
|
||||||
<div class="modal-container">
|
<div class="modal-container">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
|
@ -23,6 +23,10 @@ export default {
|
||||||
} else return;
|
} else return;
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
},
|
},
|
||||||
|
handleClick(event) {
|
||||||
|
if (event.target !== event.currentTarget) return;
|
||||||
|
this.$emit("close");
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue