index.uts 551 字节
Newer Older
DCloud-WZF's avatar
DCloud-WZF 已提交
1 2
type State = {
  lifeCycleNum : number,
3 4
  // 状态栏高度
  statusBarHeight : number,
DCloud-WZF's avatar
DCloud-WZF 已提交
5 6 7 8
  // 设备像素比
  devicePixelRatio : number
}

9
export const state = reactive({ lifeCycleNum: 0, statusBarHeight: 0, devicePixelRatio: 1 } as State)
DCloud-WZF's avatar
DCloud-WZF 已提交
10 11 12 13 14

export const setLifeCycleNum = (num : number) => {
  state.lifeCycleNum = num
}

15 16
export const setStatusBarHeight = (height : number) => {
  state.statusBarHeight = height
DCloud-WZF's avatar
DCloud-WZF 已提交
17 18 19 20
}

export const setDevicePixelRatio = (devicePixelRatio : number) => {
  state.devicePixelRatio = devicePixelRatio
DCloud-WZF's avatar
DCloud-WZF 已提交
21
}