mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-23 08:13:01 +00:00
ImageModal Bilder
This commit is contained in:
parent
cf318212ba
commit
f585b5f90c
2 changed files with 8 additions and 3 deletions
|
@ -1,6 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<ImageModal v-model="modal_visible" />
|
<ImageModal v-model="modal_visible" :imageUrl="image_url" />
|
||||||
|
|
||||||
<button class="button" @click="modal_visible = true">
|
<button class="button" @click="modal_visible = true">
|
||||||
Türken {{ day + 1 }}
|
Türken {{ day + 1 }}
|
||||||
</button>
|
</button>
|
||||||
|
@ -21,6 +20,10 @@ import ImageModal from "./ImageModal.vue";
|
||||||
export default class CalendarDoor extends Vue {
|
export default class CalendarDoor extends Vue {
|
||||||
day!: number;
|
day!: number;
|
||||||
modal_visible = false;
|
modal_visible = false;
|
||||||
|
|
||||||
|
private get image_url(): string {
|
||||||
|
return "http://localhost:8000/api/days/picture/" + this.day;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<!-- <p class="image is-4by3"> -->
|
<!-- <p class="image is-4by3"> -->
|
||||||
<img src="https://bulma.io/images/placeholders/1280x960.png" alt="" />
|
<img :src="imageUrl" alt="" />
|
||||||
<!-- </p> -->
|
<!-- </p> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -16,10 +16,12 @@ import { Options, Vue } from "vue-class-component";
|
||||||
@Options({
|
@Options({
|
||||||
props: {
|
props: {
|
||||||
modelValue: Boolean,
|
modelValue: Boolean,
|
||||||
|
imageUrl: String,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
export default class ImageModal extends Vue {
|
export default class ImageModal extends Vue {
|
||||||
modelValue!: boolean;
|
modelValue!: boolean;
|
||||||
|
imageUrl!: string;
|
||||||
|
|
||||||
public created(): void {
|
public created(): void {
|
||||||
window.addEventListener("keydown", (e) => {
|
window.addEventListener("keydown", (e) => {
|
||||||
|
|
Loading…
Reference in a new issue