Files
timmal/app/composables/usePageTitle.ts
Lucien Cartier-Tilet e284c07de0
Some checks failed
ci / ci (22, ubuntu-latest) (push) Failing after 7m11s
feat(ui): basic layout
2025-12-09 05:40:59 +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,
};
};