mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-23 08:13:01 +00:00
ImageModal
This commit is contained in:
parent
382ed35a48
commit
b6deb22cc8
3 changed files with 44 additions and 3 deletions
|
@ -8,7 +8,6 @@
|
||||||
"lint": "vue-cli-service lint"
|
"lint": "vue-cli-service lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bulma": "^0.9.4",
|
|
||||||
"core-js": "^3.8.3",
|
"core-js": "^3.8.3",
|
||||||
"vue": "^3.2.13",
|
"vue": "^3.2.13",
|
||||||
"vue-class-component": "^8.0.0-0"
|
"vue-class-component": "^8.0.0-0"
|
||||||
|
@ -21,6 +20,7 @@
|
||||||
"@vue/cli-plugin-typescript": "~5.0.0",
|
"@vue/cli-plugin-typescript": "~5.0.0",
|
||||||
"@vue/cli-service": "~5.0.0",
|
"@vue/cli-service": "~5.0.0",
|
||||||
"@vue/eslint-config-typescript": "^9.1.0",
|
"@vue/eslint-config-typescript": "^9.1.0",
|
||||||
|
"bulma": "^0.9.4",
|
||||||
"eslint": "^7.32.0",
|
"eslint": "^7.32.0",
|
||||||
"eslint-plugin-vue": "^8.0.3",
|
"eslint-plugin-vue": "^8.0.3",
|
||||||
"typescript": "~4.5.5"
|
"typescript": "~4.5.5"
|
||||||
|
|
|
@ -6,21 +6,27 @@
|
||||||
|
|
||||||
<CalendarDoor v-for="(_, index) in 24" :key="index" :day="index" />
|
<CalendarDoor v-for="(_, index) in 24" :key="index" :day="index" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<ImageModal />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Options, Vue } from "vue-class-component";
|
import { Options, Vue } from "vue-class-component";
|
||||||
import CalendarDoor from "./components/CalendarDoor.vue";
|
import CalendarDoor from "./components/CalendarDoor.vue";
|
||||||
|
import ImageModal from "./components/ImageModal.vue";
|
||||||
|
|
||||||
@Options({
|
@Options({
|
||||||
components: {
|
components: {
|
||||||
CalendarDoor,
|
CalendarDoor,
|
||||||
|
ImageModal,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
export default class App extends Vue {}
|
export default class App extends Vue {}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
/* @import "@/bulma/"; */
|
body {
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
35
ui/src/components/ImageModal.vue
Normal file
35
ui/src/components/ImageModal.vue
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<template>
|
||||||
|
<div class="modal is-active" v-if="visible" @click="hide">
|
||||||
|
<div class="modal-background" />
|
||||||
|
|
||||||
|
<div class="modal-content">
|
||||||
|
<!-- <p class="image is-4by3"> -->
|
||||||
|
<img src="https://bulma.io/images/placeholders/1280x960.png" alt="" />
|
||||||
|
<!-- </p> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="button" @click="show">modal</button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { Vue } from "vue-class-component";
|
||||||
|
|
||||||
|
export default class ImageModal extends Vue {
|
||||||
|
visible = false;
|
||||||
|
|
||||||
|
public created(): void {
|
||||||
|
window.addEventListener("keydown", (e) => {
|
||||||
|
if (e.key == "Escape") this.hide();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private show(): void {
|
||||||
|
this.visible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private hide(): void {
|
||||||
|
this.visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
Loading…
Reference in a new issue