Simplify page titles

This commit is contained in:
Jonathan Reinink 2019-08-08 08:50:36 -04:00
parent fa91d2e76f
commit b4d70359db
3 changed files with 6 additions and 12 deletions

View file

@ -29,9 +29,6 @@ class AppServiceProvider extends ServiceProvider
Inertia::share(function () { Inertia::share(function () {
return [ return [
'app' => [
'name' => Config::get('app.name'),
],
'auth' => [ 'auth' => [
'user' => Auth::user() ? [ 'user' => Auth::user() ? [
'id' => Auth::user()->id, 'id' => Auth::user()->id,

View file

@ -47,7 +47,7 @@ export default {
} }
}, },
mounted() { mounted() {
document.title = `Login | ${this.$page.app.name}` document.title = 'Login | Ping CRM'
}, },
methods: { methods: {
submit() { submit() {

View file

@ -72,17 +72,14 @@ export default {
} }
}, },
watch: { watch: {
title(title) { title: {
this.updatePageTitle(title) immediate: true,
handler(title) {
document.title = title ? `${title} | Ping CRM` : 'Ping CRM'
},
}, },
}, },
mounted() {
this.updatePageTitle(this.title)
},
methods: { methods: {
updatePageTitle(title) {
document.title = title ? `${title} | ${this.$page.app.name}` : this.$page.app.name
},
hideDropdownMenus() { hideDropdownMenus() {
this.showUserMenu = false this.showUserMenu = false
}, },