feat: useResponsive with device detection on SSR
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { breakpointsTailwind, useBreakpoints } from "@vueuse/core";
|
||||
|
||||
export function useResponsive() {
|
||||
const { isMobileOrTablet } = useDevice();
|
||||
const breakpoints = useBreakpoints(breakpointsTailwind, { ssrWidth: isMobileOrTablet ? 375 : 1024 });
|
||||
const isDesktop = breakpoints.greaterOrEqual("lg");
|
||||
|
||||
return { breakpoints, isDesktop };
|
||||
}
|
||||
Reference in New Issue
Block a user