Last active
May 15, 2019 11:51
-
-
Save jakedohm/f270c4b5a3992f07147c7a8b591ee015 to your computer and use it in GitHub Desktop.
Vue Component to Dim Screen
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> | |
<!-- Example Usage --> | |
<div class="menu"> | |
<ScreenDimmer :visible="menuOpen" /> | |
</div> | |
</template> | |
<script> | |
export default { | |
data() { | |
return { | |
menuOpen: false | |
} | |
} | |
} | |
</script> |
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="fixed pin z-1 bg-black ts" | |
:class="[visible ? 'opacity-75' : 'opacity-0 pointer-events-none']" | |
></div> | |
</template> | |
<script> | |
export default { | |
props: { | |
visible: Boolean, | |
}, | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The classes used in this example component are based on tailwindCSS