HomeBtn.vue 692 B

123456789101112131415161718192021222324252627282930
  1. <template>
  2. <div>
  3. <v-btn
  4. ref="btn"
  5. icon="fas fa-home"
  6. size="small"
  7. :href="
  8. !ability.can('display', 'freemium_dashboard_page') ? homeUrl : undefined
  9. "
  10. :to="
  11. ability.can('display', 'freemium_dashboard_page') ? homeUrl : undefined
  12. "
  13. class="on-primary"
  14. />
  15. <v-tooltip :activator="btn" :text="$t('welcome')" location="bottom" />
  16. </div>
  17. </template>
  18. <script setup lang="ts">
  19. import { ref } from 'vue'
  20. import { useAbility } from '@casl/vue'
  21. import { useHomeUrl } from '~/composables/utils/useHomeUrl'
  22. const { homeUrl } = useHomeUrl()
  23. const ability = useAbility()
  24. const btn = ref(null)
  25. </script>
  26. <style scoped></style>