Newer
Older
Nanping_sponge_SJJC / src / hooks / usemap.js
@liyingjing liyingjing on 25 Oct 801 bytes 数据检测
import { ref, watch } from "vue"
import useUserStore from '@/store/modules/user'
const appStore = useUserStore()

export default function () {
  const isShow = ref(true);
  const isShow2 = ref(true);

  // 监听头部
  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 = true
      isShow2.value = true
    }
  }

  function BoxShow () {
    isShow.value = !isShow.value
  };

  function BoxShow2 () {
    isShow2.value = !isShow2.value
  };

  return {
    isShow,
    isShow2,
    BoxShow,
    BoxShow2
  }
}