Added page title function for Composition API components.

This commit is contained in:
DebaucheryLibrarian
2023-06-24 22:30:55 +02:00
parent fdad61465c
commit 6de6053eaa
3 changed files with 22 additions and 6 deletions

View File

@@ -8,6 +8,7 @@ import router from './router';
import initStore from './store';
import initUiObservers from './ui/observers';
import initAuthObservers from './auth/observers';
import setPageTitle from './set-page-title';
import { formatDate, formatDuration } from './format';
@@ -101,12 +102,7 @@ async function init() {
},
watch: {
pageTitle(title) {
if (title) {
document.title = `traxxx - ${title}`;
return;
}
document.title = 'traxxx';
setPageTitle(title); // for Options API components
},
},
beforeCreate() {