XiaoDaiGua-Ray 3fb016513b v4.2.2
2023-10-10 15:05:48 +08:00

39 lines
733 B
TypeScript

/**
*
* @author Ray <https://github.com/XiaoDaiGua-Ray>
*
* @date 2023-06-20
*
* @workspace ray-template
*
* @remark 今天也是元气满满撸代码的一天
*/
/**
*
* 统一管理是否处于锁屏状态
*
* 可以根据后台接口进行替换该变量, 只要是一个响应式的变量值即可
*/
import { useStorage } from '@vueuse/core'
const appLockScreen = useStorage('isAppLockScreen', false, sessionStorage, {
mergeDefaults: true,
})
const useAppLockScreen = () => {
const setLockAppScreen = (bool: boolean) => {
appLockScreen.value = bool
}
const getLockAppScreen = () => appLockScreen.value
return {
setLockAppScreen,
getLockAppScreen,
}
}
export default useAppLockScreen