feat(short-drama-agent-front): 优化分镜界面并新增弹窗手势
This commit is contained in:
1 parent
b15a6011ce
commit
d68f03471c
59 files changed
+2694
-857
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import { onScopeDispose, ref } from 'vue'
|
||||
|
||||
/**
|
||||
* 与公共弹窗的手机断点同步,旋转或调整窗口时即时更新。
|
||||
* @returns 当前是否使用手机面板布局
|
||||
*/
|
||||
export function useMobileViewport() {
|
||||
const query = window.matchMedia('(max-width: 639px)')
|
||||
/** 手机布局只由当前视口决定,不写入用户偏好。 */
|
||||
const mobile = ref(query.matches)
|
||||
/**
|
||||
* 同步视口断点。
|
||||
* @param event 媒体查询变化
|
||||
*/
|
||||
function update(event: MediaQueryListEvent) {
|
||||
mobile.value = event.matches
|
||||
}
|
||||
query.addEventListener('change', update)
|
||||
onScopeDispose(() => query.removeEventListener('change', update))
|
||||
return mobile
|
||||
}
|
||||
Reference in new issue
Block a user