Some checks failed
ci / ci (22, ubuntu-latest) (push) Has been cancelled
16 lines
427 B
TypeScript
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,
|
|
};
|
|
};
|