useFullContent.ts 928 B

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * Copyright (c) 2013-Now https://jeesite.com All rights reserved.
  3. * No deletion without permission, or be held responsible to law.
  4. * @author Vben、ThinkGem
  5. */
  6. import { computed, unref } from 'vue';
  7. import { useAppStore } from '@jeesite/core/store/modules/app';
  8. import { useRouter } from 'vue-router';
  9. /**
  10. * @description: Full screen display content
  11. */
  12. export const useFullContent = () => {
  13. const appStore = useAppStore();
  14. const router = useRouter();
  15. const { currentRoute } = router;
  16. // Whether to display the content in full screen without displaying the menu
  17. const getFullContent = computed(() => {
  18. const route = unref(currentRoute);
  19. if (route.path.includes('__full__')) {
  20. return true;
  21. }
  22. const query = route.query;
  23. if (query && Reflect.has(query, '__full__')) {
  24. return true;
  25. }
  26. return appStore.getProjectConfig.fullContent;
  27. });
  28. return { getFullContent };
  29. };