SwitchUser.vue 958 B

123456789101112131415161718192021222324252627282930313233343536
  1. <!--
  2. Switch year bar : Barre qui s'affiche lorsque l'utilisateur possède un compte multi user
  3. -->
  4. <template>
  5. <UiSystemBar color="ot_info" v-if="show">
  6. <template #bar.text>
  7. <v-icon small>fas fa-exclamation-triangle</v-icon>
  8. <span v-html="$t('multi_account_alert', { fullname })"></span>
  9. <v-icon class="ml-1" small>fa fa-users</v-icon>
  10. {{$t('multi_account_alert_next')}}
  11. </template>
  12. </UiSystemBar>
  13. </template>
  14. <script lang="ts">
  15. import { defineComponent, useStore} from '@nuxtjs/composition-api'
  16. import {accessState, AnyStore} from "~/types/interfaces";
  17. import {State} from "@vuex-orm/core";
  18. export default defineComponent({
  19. setup () {
  20. const store:AnyStore = useStore<State>()
  21. const profileAccess:accessState = store.state.profile.access
  22. return {
  23. show: profileAccess.hasFamilyMenu,
  24. fullname: `${profileAccess.givenName} ${profileAccess.name}`
  25. }
  26. }
  27. })
  28. </script>
  29. <style scoped>
  30. </style>