updated title handling

This commit is contained in:
Jörn-Michael Miehe 2023-11-01 01:12:03 +00:00
parent 5683438a19
commit 59cf7202f4

View file

@ -2,7 +2,7 @@
<section class="hero is-small is-primary" style="overflow-x: auto">
<div class="hero-body">
<h1 class="title is-uppercase">{{ title }}</h1>
<h2 class="subtitle">Der Gelöt</h2>
<h2 class="subtitle">{{ subtitle }}</h2>
</div>
</section>
@ -47,15 +47,20 @@ import UserView from "./components/UserView.vue";
export default class extends Vue {
public is_admin = false;
public title = "Adventskalender";
public subtitle = "Lorem Ipsum";
public footer = "";
public mounted(): void {
Promise.all([
this.$advent22.api_get<string>("user/title"),
this.subtitle, // TODO
this.$advent22.api_get<string>("user/footer"),
])
.then(([title, footer]) => {
.then(([title, subtitle, footer]) => {
document.title = `${title} ${subtitle}`;
this.title = title;
this.subtitle = subtitle;
this.footer = footer;
})
.catch((error) => alert(this.$advent22.format_user_error(error)));