useFullContent.ts 762 B

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