useTishi.js 454 B

1234567891011121314151617181920212223
  1. import cacheManager from "@/utils/cacheManager";
  2. import {ref} from "vue"
  3. let code = 'is-show-tishi'
  4. export function useShowTishi() {
  5. const isShowTishi = ref(true)
  6. function getShowTishi() {
  7. return !cacheManager.get(code);
  8. }
  9. function updateDate() {
  10. cacheManager.set(code, true)
  11. isShowTishi.value = false;
  12. }
  13. isShowTishi.value = getShowTishi()
  14. return {
  15. isShowTishi,
  16. updateDate,
  17. }
  18. }