useFullContent.ts 800 B

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