mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-23 00:03:07 +00:00
DoorMapEditor Drawer usage
This commit is contained in:
parent
dbd0e4962c
commit
ddb893ea6c
1 changed files with 13 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<BulmaDrawer header="Türchen bearbeiten">
|
<BulmaDrawer header="Türchen bearbeiten" :ready="is_loaded" @open="on_open">
|
||||||
<div class="is-flex is-align-items-center is-justify-content-space-between">
|
<div class="is-flex is-align-items-center is-justify-content-space-between">
|
||||||
<BulmaButton
|
<BulmaButton
|
||||||
:disabled="current_step === 0"
|
:disabled="current_step === 0"
|
||||||
|
@ -67,6 +67,8 @@ import DoorPlacer from "./editor/DoorPlacer.vue";
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
export default class extends Vue {
|
export default class extends Vue {
|
||||||
|
public is_loaded = true;
|
||||||
|
|
||||||
public readonly steps: Step[] = [
|
public readonly steps: Step[] = [
|
||||||
{ label: "Platzieren", icon: "fa-solid fa-crosshairs" },
|
{ label: "Platzieren", icon: "fa-solid fa-crosshairs" },
|
||||||
{ label: "Ordnen", icon: "fa-solid fa-list-ol" },
|
{ label: "Ordnen", icon: "fa-solid fa-list-ol" },
|
||||||
|
@ -95,6 +97,16 @@ export default class extends Vue {
|
||||||
return this.$advent22.api_put("admin/doors", data);
|
return this.$advent22.api_put("admin/doors", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public on_open(): void {
|
||||||
|
this.is_loaded = false;
|
||||||
|
|
||||||
|
this.load_doors()
|
||||||
|
.then(() => (this.is_loaded = true))
|
||||||
|
.catch(([reason, endpoint]) => {
|
||||||
|
alert(`Fehler: ${reason} in ${endpoint}`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public mounted(): void {
|
public mounted(): void {
|
||||||
this.load_doors().catch(([reason, endpoint]) => {
|
this.load_doors().catch(([reason, endpoint]) => {
|
||||||
alert(`Fehler: ${reason} in ${endpoint}`);
|
alert(`Fehler: ${reason} in ${endpoint}`);
|
||||||
|
|
Loading…
Reference in a new issue