import type { NavigationGuardWithThis } from 'vue-router';

const titleGuard: NavigationGuardWithThis<undefined> = (to, from, next) => {
  next();
  document.title = to.meta.title ? `${to.meta.title} | 悦码` : '悦码';
};

export { titleGuard };
