Skip to content

Commit 23860b7

Browse files
committed
feat(routing): provide title fallback if there is nothing
1 parent 6efff8b commit 23860b7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/router/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ router.beforeEach((to, from, next) => {
3030

3131
// If a route with a title was found, set the document (page) title to that value.
3232
if(nearestWithTitle) document.title = nearestWithTitle.meta.title;
33+
if(!nearestWithTitle) document.title = 'Vue Zephyr'; // Fall back if there is no title set
3334

3435
// Remove any stale meta tags from the document using the key attribute we set below.
3536
Array.from(document.querySelectorAll('[data-vue-router-controlled]')).map(el => el?.parentNode?.removeChild(el));

0 commit comments

Comments
 (0)