import { ref, watch } from "vue" import useUserStore from '@/store/modules/user' const appStore = useUserStore() export default function () { const isShow = ref(false); const isShow2 = ref(false); // 监听头部 watch( () => appStore.TitleIndex, (newValue, oldValue) => { console.log("TitleIndex", newValue, oldValue); watchTitleIndex(); }, { immediate: true } ) // 监听头部改变 function watchTitleIndex () { if (appStore.TitleIndex == 3) { } if (appStore.TitleIndex == 1) { isShow.value = false isShow2.value = false } } function BoxShow () { isShow.value = !isShow.value }; function BoxShow2 () { isShow2.value = !isShow2.value }; return { isShow, isShow2, BoxShow, BoxShow2 } }