petra-tool / frontend / src / views / admin / Index.vue
Index.vue
Raw
<template>
  <div>

    <div v-if="!loaded">
      Loading...
    </div>

    <div v-if="loaded">
      <router-view/>
    </div>

  </div>
</template>

<script>
export default {
  name: "admin-index",
  data: function () {
    return {
      loaded: false,
    }
  },
  mounted() {
    this.$auth.load().then(() => {
        if (this.$auth.check()) {
          // If user is authenticated update store
          this.$store.dispatch('site/setTeam', this.$auth.user())
          this.loaded = true
        } else {
          this.loaded = false
        }
      }
    );
  }
}
</script>

<style scoped>

</style>