hydration.mjs 501 B

1234567891011121314151617181920
  1. // Composables
  2. import { useDisplay } from "./display.mjs"; // Utilities
  3. import { onMounted, shallowRef } from 'vue';
  4. import { IN_BROWSER } from "../util/index.mjs";
  5. export function useHydration() {
  6. if (!IN_BROWSER) return shallowRef(false);
  7. const {
  8. ssr
  9. } = useDisplay();
  10. if (ssr) {
  11. const isMounted = shallowRef(false);
  12. onMounted(() => {
  13. isMounted.value = true;
  14. });
  15. return isMounted;
  16. } else {
  17. return shallowRef(true);
  18. }
  19. }
  20. //# sourceMappingURL=hydration.mjs.map