Compare commits

...

2 Commits

Author SHA1 Message Date
DebaucheryLibrarian 01b3cc42af 1.228.12 2023-06-24 22:30:58 +02:00
DebaucheryLibrarian 6de6053eaa Added page title function for Composition API components. 2023-06-24 22:30:55 +02:00
5 changed files with 25 additions and 9 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() {

View File

@ -1,5 +1,7 @@
import { createRouter, createWebHistory } from 'vue-router';
import setPageTitle from './set-page-title';
import Home from '../components/home/home.vue';
import Login from '../components/auth/login.vue';
import Signup from '../components/auth/signup.vue';
@ -257,11 +259,17 @@ const routes = [
path: '/stats',
component: Stats,
name: 'stats',
meta: {
title: 'Stats',
},
},
{
path: '/not-found',
name: 'not-found',
component: NotFound,
meta: {
title: 'Not Found',
},
},
{
path: '/:catchAll(.*)',
@ -276,4 +284,6 @@ const router = createRouter({
routes,
});
router.beforeEach((to) => setPageTitle(to.meta.title));
export default router;

View File

@ -0,0 +1,10 @@
function setPageTitle(name) {
if (name) {
document.title = `traxxx - ${name}`;
return;
}
document.title = 'traxxx';
}
export default setPageTitle;

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "traxxx",
"version": "1.228.11",
"version": "1.228.12",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "traxxx",
"version": "1.228.11",
"version": "1.228.12",
"license": "ISC",
"dependencies": {
"@casl/ability": "^5.2.2",

View File

@ -1,6 +1,6 @@
{
"name": "traxxx",
"version": "1.228.11",
"version": "1.228.12",
"description": "All the latest porn releases in one place",
"main": "src/app.js",
"scripts": {