index.uts 551 字节
Newer Older
DCloud-WZF's avatar
DCloud-WZF 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
type State = {
  lifeCycleNum : number,
  // 状态栏 + 导航栏高度
  headerHeight : number,
  // 设备像素比
  devicePixelRatio : number
}

export const state = reactive({ lifeCycleNum: 0, headerHeight: 0, devicePixelRatio: 1 } as State)

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

export const setHeaderHeight = (height : number) => {
  state.headerHeight = height
}

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