mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-01 15:44:30 +08:00
缩放可以实时检测是否横屏
This commit is contained in:
1 parent
1209acce50
commit
754edac71a
1 file changed
+7
-1
+7
-1
@@ -16,7 +16,13 @@ const dragFnMap = new Map<DragFn, DragMap>();
|
||||
/**
|
||||
* 是否是移动设备
|
||||
*/
|
||||
export const isMobile = matchMedia('(max-width: 600px)').matches;
|
||||
export let isMobile = matchMedia('(max-width: 600px)').matches;
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
requestAnimationFrame(() => {
|
||||
isMobile = matchMedia('(max-width: 600px)').matches;
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* 向一个元素添加拖拽事件
|
||||
|
||||
Reference in new issue
Block a user