layoutStore.ts 590 B

1234567891011121314151617181920212223
  1. import type { Ref } from "@vue/reactivity";
  2. export const useLayoutStore = defineStore('layout', () => {
  3. const isFooterVisible: Ref<boolean> = ref(false)
  4. const setIsFooterVisible = (value: boolean) => {
  5. isFooterVisible.value = value
  6. }
  7. const isAnchoredSectionOnScreen: Ref<Record<string, boolean>> = ref({})
  8. const setIsAnchoredSectionOnScreen = (sectionId: string, value: boolean) => {
  9. isAnchoredSectionOnScreen.value[sectionId] = value
  10. }
  11. return {
  12. isFooterVisible,
  13. setIsFooterVisible,
  14. isAnchoredSectionOnScreen,
  15. setIsAnchoredSectionOnScreen
  16. }
  17. })