AIchat/src/store/status/index.js
2025-05-23 15:05:31 +08:00

16 lines
497 B
JavaScript

import {ref} from 'vue'
import {createGlobalState, useStorage} from "@vueuse/core";
import {uniStorage} from "@/utils/uniStorage";
export const useStatus =createGlobalState(()=>{
const currentNavbar=ref({title:'',url:''})
const applyTabbarIndex=ref(0)
const statusBarHeight = ref(window?.plus?.navigator?.getStatusbarHeight() ?? 0)
const tabBarIndex = useStorage('tabBarIndex', 0, uniStorage)
return {
statusBarHeight,
applyTabbarIndex,
currentNavbar,
tabBarIndex
}
})