headerTitle.ts 441 B

1234567891011121314
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import useMetaTitle from '#shared/composables/useMetaTitle.ts'
  3. import type { NavigationHookAfter, RouteLocationNormalized } from 'vue-router'
  4. const headerTitleGuard: NavigationHookAfter = (to: RouteLocationNormalized) => {
  5. if (to.meta.title) {
  6. const { setViewTitle } = useMetaTitle()
  7. setViewTitle(to.meta.title)
  8. }
  9. }
  10. export default headerTitleGuard