-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(nuxt-admin): hide drawer on mobile only
- Loading branch information
Showing
4 changed files
with
14 additions
and
10 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
import {breakpointsTailwind, useBreakpoints} from '@vueuse/core'; | ||
|
||
export const useAdminDrawer = () => useState('admin-drawer', () => true); | ||
|
||
export const $breakpoints = useBreakpoints(breakpointsTailwind); | ||
|
||
export const isMobile = $breakpoints.smaller('sm'); // only smaller than lg | ||
|
||
export const hideDrawerOnMobile = () => { | ||
if (isMobile.value) { | ||
useAdminDrawer().value = false; | ||
} | ||
}; |
5696bdf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for gits-nuxt-admin ready!
✅ Preview
https://gits-nuxt-admin-47hzebh19-gravitano.vercel.app
Built with commit 5696bdf.
This pull request is being automatically deployed with vercel-action