Files
timmal/app/composables/usePageTitle.ts
Lucien Cartier-Tilet db91dfc8fd
Some checks failed
ci / ci (22, ubuntu-latest) (push) Has been cancelled
feat(ui): basic layout
2025-12-09 05:17:54 +01:00

16 lines
427 B
TypeScript

export const usePageTitle = () => {
const pageName = useState<string>('pageName', () => '');
const title = computed<string>(() => (pageName.value.length > 0 ? `${pageName.value} - Tímmál` : 'Tímmál'));
const setPageName = (newName: string) => {
pageName.value = newName;
useHead({ title: title.value });
};
return {
title: readonly(title),
pageName: readonly(pageName),
setPageName,
};
};