mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-23 00:03:07 +00:00
Show time to next door in Calendar component
This commit is contained in:
parent
59cf7202f4
commit
e4f9ded5c8
1 changed files with 14 additions and 0 deletions
|
@ -6,6 +6,10 @@
|
|||
<div class="level-left">
|
||||
<figcaption class="level-item has-text-primary-dark">
|
||||
{{ figure_caption }}
|
||||
<template v-if="next_door !== null">
|
||||
<br />
|
||||
Zeit zum nächsten Türchen: <CountDown :millis="next_door" />
|
||||
</template>
|
||||
</figcaption>
|
||||
</div>
|
||||
<div class="level-right">
|
||||
|
@ -42,6 +46,7 @@
|
|||
import { Door } from "@/lib/door";
|
||||
import { Options, Vue } from "vue-class-component";
|
||||
|
||||
import CountDown from "./CountDown.vue";
|
||||
import MultiModal from "./MultiModal.vue";
|
||||
import BulmaButton from "./bulma/Button.vue";
|
||||
import CalendarDoor from "./calendar/CalendarDoor.vue";
|
||||
|
@ -49,6 +54,7 @@ import ThouCanvas from "./calendar/ThouCanvas.vue";
|
|||
|
||||
@Options({
|
||||
components: {
|
||||
CountDown,
|
||||
MultiModal,
|
||||
BulmaButton,
|
||||
ThouCanvas,
|
||||
|
@ -65,6 +71,14 @@ export default class extends Vue {
|
|||
public show_doors = false;
|
||||
private multi_modal?: MultiModal;
|
||||
public figure_caption = this.idle_caption;
|
||||
public next_door: number | null = null;
|
||||
|
||||
public mounted(): void {
|
||||
this.$advent22
|
||||
.api_get<number | null>("user/next_door")
|
||||
.then((next_door) => (this.next_door = next_door))
|
||||
.catch((error) => alert(this.$advent22.format_user_error(error)));
|
||||
}
|
||||
|
||||
public modal_handle(modal: MultiModal) {
|
||||
this.multi_modal = modal;
|
||||
|
|
Loading…
Reference in a new issue