globalComponents.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import type { App } from 'vue'
  3. import type { FormKit } from '@formkit/vue'
  4. import CommonAlert from '#shared/components/CommonAlert/CommonAlert.vue'
  5. import CommonIcon from '#shared/components/CommonIcon/CommonIcon.vue'
  6. import CommonLink from '#shared/components/CommonLink/CommonLink.vue'
  7. import CommonDateTime from '#shared/components/CommonDateTime/CommonDateTime.vue'
  8. import CommonLabel from '#shared/components/CommonLabel/CommonLabel.vue'
  9. import CommonBadge from '#shared/components/CommonBadge/CommonBadge.vue'
  10. import type { RouterLink, RouterView } from 'vue-router'
  11. declare module '@vue/runtime-core' {
  12. export interface GlobalComponents {
  13. CommonAlert: typeof CommonAlert
  14. CommonIcon: typeof CommonIcon
  15. CommonLink: typeof CommonLink
  16. CommonDateTime: typeof CommonDateTime
  17. CommonBadge: typeof CommonBadge
  18. FormKit: typeof FormKit
  19. RouterView: typeof RouterView
  20. RouterLink: typeof RouterLink
  21. }
  22. }
  23. export default function initializeGlobalComponents(app: App): void {
  24. app.component('CommonAlert', CommonAlert)
  25. app.component('CommonIcon', CommonIcon)
  26. app.component('CommonLink', CommonLink)
  27. app.component('CommonDateTime', CommonDateTime)
  28. app.component('CommonLabel', CommonLabel)
  29. app.component('CommonBadge', CommonBadge)
  30. }