From 5a274de64f66528ef2d7ae5c1e2c72eb2ee9b448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Mon, 12 Sep 2022 22:37:55 +0000 Subject: [PATCH] prop typing --- ui/src/components/Clock.vue | 4 ++-- ui/src/components/THWLogo.vue | 8 ++++---- ui/src/components/TickerBar.vue | 4 ++-- ui/src/components/TitleBar.vue | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ui/src/components/Clock.vue b/ui/src/components/Clock.vue index 0298f8f..6c9670d 100644 --- a/ui/src/components/Clock.vue +++ b/ui/src/components/Clock.vue @@ -11,8 +11,8 @@ export default class Clock extends Vue { private formatted = ""; private interval?: number; - @Prop() - public format!: string; + @Prop({ required: true }) + private readonly format!: string; private update(): void { this.formatted = DateTime.now() diff --git a/ui/src/components/THWLogo.vue b/ui/src/components/THWLogo.vue index 5e60701..f9d0772 100644 --- a/ui/src/components/THWLogo.vue +++ b/ui/src/components/THWLogo.vue @@ -23,11 +23,11 @@ import { Component, Prop, Vue } from "vue-property-decorator"; @Component export default class THWLogo extends Vue { - @Prop() - public above!: string; + @Prop({ required: true }) + private readonly above!: string; - @Prop() - public below!: string; + @Prop({ required: true }) + private readonly below!: string; } diff --git a/ui/src/components/TickerBar.vue b/ui/src/components/TickerBar.vue index ed0f5d3..da29358 100644 --- a/ui/src/components/TickerBar.vue +++ b/ui/src/components/TickerBar.vue @@ -15,8 +15,8 @@ import { Component, Prop, Vue } from "vue-property-decorator"; @Component export default class TickerBar extends Vue { - @Prop() - public content!: string; + @Prop({ required: true }) + private readonly content!: string; get marqueeDuration(): string { // 10 seconds + another second per 7 chars diff --git a/ui/src/components/TitleBar.vue b/ui/src/components/TitleBar.vue index 3e32108..64dd850 100644 --- a/ui/src/components/TitleBar.vue +++ b/ui/src/components/TitleBar.vue @@ -41,17 +41,17 @@ export default class TitleBar extends Vue { @Prop({ default: "Technisches Hilfswerk", }) - public logo_above!: string; + private readonly logo_above!: string; @Prop({ default: "OV Musterstadt", }) - public logo_below!: string; + private readonly logo_below!: string; @Prop({ default: "TITLE", }) - public title!: string; + private readonly title!: string; }