useFullContent.ts 838 B

12345678910111213141516171819202122232425262728
  1. import { computed, unref } from 'vue';
  2. import { useAppStore } from '/@/store/modules/app';
  3. import { useRouter } from 'vue-router';
  4. /**
  5. * @description: Full screen display content
  6. */
  7. export const useFullContent = () => {
  8. const appStore = useAppStore();
  9. const router = useRouter();
  10. const { currentRoute } = router;
  11. // Whether to display the content in full screen without displaying the menu
  12. const getFullContent = computed(() => {
  13. // Query parameters, the full screen is displayed when the address bar has a full parameter
  14. const route = unref(currentRoute);
  15. const query = route.query;
  16. if (query && Reflect.has(query, '__full__')) {
  17. return true;
  18. }
  19. // Return to the configuration in the configuration file
  20. return appStore.getProjectConfig.fullContent;
  21. });
  22. return { getFullContent };
  23. };