| 123456789101112131415161718192021222324252627282930313233343536 |
- import type { Ref } from "@vue/reactivity";
- export const useLayoutStore = defineStore('layout', () => {
- const isHeaderVisible: Ref<boolean> = ref(false)
- const setIsHeaderVisible = (value: boolean) => {
- isHeaderVisible.value = value
- }
- const isFooterVisible: Ref<boolean> = ref(false)
- const setIsFooterVisible = (value: boolean) => {
- isFooterVisible.value = value
- }
- const resetAnchoredSections = () =>{
- isAnchoredSectionOnScreen.value = {}
- }
- const isAnchoredSectionOnScreen: Ref<Record<string, boolean>> = ref({})
- const setIsAnchoredSectionOnScreen = (sectionId: string, value: boolean) => {
- isAnchoredSectionOnScreen.value[sectionId] = value
- }
- return {
- isHeaderVisible,
- setIsHeaderVisible,
- isFooterVisible,
- setIsFooterVisible,
- isAnchoredSectionOnScreen,
- resetAnchoredSections,
- setIsAnchoredSectionOnScreen
- }
- })
|