mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat(projects): 添加判断是否是移动端的hooks
This commit is contained in:
@ -7,6 +7,7 @@ import useRouteProps from './useRouteProps';
|
||||
import useBoolean from './useBoolean';
|
||||
import useLoading from './useLoading';
|
||||
import useScrollBehavior from './useScrollBehavior';
|
||||
import useIsMobile from './useIsMobile';
|
||||
|
||||
export {
|
||||
useAppTitle,
|
||||
@ -17,5 +18,6 @@ export {
|
||||
useRouteProps,
|
||||
useBoolean,
|
||||
useLoading,
|
||||
useScrollBehavior
|
||||
useScrollBehavior,
|
||||
useIsMobile
|
||||
};
|
||||
|
11
src/hooks/common/useIsMobile.ts
Normal file
11
src/hooks/common/useIsMobile.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { useBreakpoints, breakpointsTailwind } from '@vueuse/core';
|
||||
|
||||
/** 是否是移动端 */
|
||||
export default function useIsMobile() {
|
||||
const breakpoints = useBreakpoints(breakpointsTailwind);
|
||||
const isMobile = breakpoints.smaller('lg');
|
||||
|
||||
return {
|
||||
isMobile
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user