<template>
  <div class="">
    <div v-if="isLoggedIn === null">Загрузка</div>
    <component
      :is="isLoggedIn === 0 ? 'IsAuth' : isLoggedIn === 1 ? 'NotAuth' : ''"
    />
  </div>
</template>
<script>
import { defineAsyncComponent, defineComponent } from 'vue';
export default defineComponent({
  name: 'PageIndex',
  data() {
    return {
      isLoggedIn: 0,
      // 0 - для NotAuth.vue, 1 - для Auth.vue
    };
  },
  components: {
    IsAuth: defineAsyncComponent(() => import('../components/NotAuth.vue')),
    NotAuth: defineAsyncComponent(() => import('../components/Auth.vue')),
  },
});
</script>
<style scoped></style>
