2023-01-19 17:59:18 +00:00
|
|
|
<template>
|
|
|
|
<section>
|
|
|
|
<div class="content">
|
|
|
|
<ul>
|
|
|
|
<li>Linksklick + Ziehen: Neues Türchen erstellen</li>
|
|
|
|
<li>Rechtsklick + Ziehen: Türchen verschieben</li>
|
|
|
|
<li>Doppel- oder Mittelklick: Türchen löschen</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<figure class="image">
|
|
|
|
<img src="@/assets/adventskalender.jpg" />
|
2023-01-27 00:23:41 +00:00
|
|
|
<RectangleCanvas ref="rect_pad" />
|
2023-01-19 17:59:18 +00:00
|
|
|
</figure>
|
|
|
|
</section>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { Vue, Options } from "vue-class-component";
|
2023-01-23 23:37:23 +00:00
|
|
|
import { Rectangle } from "../rects/rectangles";
|
2023-01-27 00:23:41 +00:00
|
|
|
import RectangleCanvas from "./RectangleCanvas.vue";
|
2023-01-19 17:59:18 +00:00
|
|
|
|
|
|
|
@Options({
|
|
|
|
components: {
|
2023-01-27 00:23:41 +00:00
|
|
|
RectangleCanvas,
|
2023-01-19 17:59:18 +00:00
|
|
|
},
|
2023-01-23 23:37:23 +00:00
|
|
|
props: {
|
|
|
|
rectangles: Array,
|
|
|
|
},
|
|
|
|
emits: ["update:rectangles"],
|
2023-01-19 17:59:18 +00:00
|
|
|
})
|
2023-01-24 23:19:25 +00:00
|
|
|
export default class extends Vue {
|
2023-01-23 23:37:23 +00:00
|
|
|
private rectangles!: Rectangle[];
|
|
|
|
|
|
|
|
declare $refs: {
|
2023-01-27 00:23:41 +00:00
|
|
|
rect_pad: RectangleCanvas;
|
2023-01-23 23:37:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
public mounted() {
|
|
|
|
this.$refs.rect_pad.rectangles = this.rectangles;
|
|
|
|
}
|
|
|
|
|
|
|
|
public beforeUnmount() {
|
|
|
|
this.$emit("update:rectangles", this.rectangles);
|
|
|
|
}
|
|
|
|
}
|
2023-01-19 17:59:18 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
section > figure {
|
|
|
|
user-select: none;
|
|
|
|
}
|
|
|
|
</style>
|