layout.config.uts
886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* 布局模式配置
* 预留 portrait / desktop,当前仅使用 pad
*/
export type LayoutMode = "desktop" | "pad" | "portrait"
export type LayoutModeConfig = {
baseHeight: number
baseWidth: number
maxWidth: null | number
minWidth: number
mode: LayoutMode
name: string
}
const portraitConfig: LayoutModeConfig = {
mode: "portrait",
name: "竖屏布局",
baseWidth: 750,
baseHeight: 1334,
minWidth: 0,
maxWidth: 768
};
const padConfig: LayoutModeConfig = {
mode: "pad",
name: "Pad布局",
baseWidth: 1024,
baseHeight: 768,
minWidth: 768,
maxWidth: 1440
};
const desktopConfig: LayoutModeConfig = {
mode: "desktop",
name: "大屏布局",
baseWidth: 1920,
baseHeight: 1080,
minWidth: 1440,
maxWidth: null as null | number
};
export const LAYOUT_MODES = {
portrait: portraitConfig,
pad: padConfig,
desktop: desktopConfig
} as UTSJSONObject;