feat(ui): basic layout
This commit is contained in:
15
app/composables/usePageTitle.ts
Normal file
15
app/composables/usePageTitle.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
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,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user