Skip to content

Instantly share code, notes, and snippets.

@dsternlicht
Last active November 27, 2018 14:59
Show Gist options
  • Save dsternlicht/dbfb39d431cd2042ba7a9b937bd523cb to your computer and use it in GitHub Desktop.
Save dsternlicht/dbfb39d431cd2042ba7a9b937bd523cb to your computer and use it in GitHub Desktop.
Vue modal component
<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