Last active
October 8, 2022 07:29
-
-
Save shinokada/06fbd34c366e948b4feb22ebef65f6e1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <script> | |
| ... | |
| let activateClickOutside = true; | |
| let drawerHidden = true; | |
| $: if (width >= breakPoint) { | |
| drawerHidden = false; | |
| activateClickOutside = false; | |
| } else { | |
| drawerHidden = true; | |
| activateClickOutside = true; | |
| } | |
| onMount(() => { | |
| // console.log('innerwidth', width); | |
| if (width >= breakPoint) { | |
| drawerHidden = false; | |
| activateClickOutside = false; | |
| } else { | |
| drawerHidden = true; | |
| activateClickOutside = true; | |
| } | |
| }); | |
| </script> | |
| <Drawer | |
| transitionType="fly" | |
| {backdrop} | |
| {transitionParams} | |
| bind:hidden={drawerHidden} | |
| bind:activateClickOutside | |
| leftOffset="top-16 h-screen left-0" | |
| id="sidebar"> | |
| ... | |
| </Drawer> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment