Last active
November 27, 2018 14:59
-
-
Save dsternlicht/dbfb39d431cd2042ba7a9b937bd523cb to your computer and use it in GitHub Desktop.
Vue modal component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="modal" v-bind:class="customClass" v-bind:style="{ display: show ? 'block' : 'none' }"> | |
<div class="overlay" @click="closeCallback()"></div> | |
<div class="modal_content"> | |
<slot></slot> | |
<button title="Close" class="close_modal" @click="closeCallback()"> | |
<i class="fas fa-times"></i> | |
</button> | |
</div> | |
</div> | |
</template> | |
<script> | |
export default { | |
name: 'Modal', | |
props: { | |
show: Boolean, | |
customClass: String, | |
closeCallback: Function | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment