Finished guestbook and gallery. started diary
This commit is contained in:
62
frontend/src/dialogues/standard/ChooseDialog.vue
Normal file
62
frontend/src/dialogues/standard/ChooseDialog.vue
Normal file
@@ -0,0 +1,62 @@
|
||||
<template>
|
||||
<DialogWidget ref="dialog" :title="title" :icon="icon" :show-close="true" :buttons="dialogButtons" :modal="true"
|
||||
:isTitleTranslated="false" width="30em" height="15em">
|
||||
<div class="dialog-body">
|
||||
<p>{{ message }}</p>
|
||||
</div>
|
||||
</DialogWidget>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DialogWidget from "@/components/DialogWidget.vue";
|
||||
|
||||
export default {
|
||||
name: "ChooseDialog",
|
||||
components: {
|
||||
DialogWidget,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: "Bestätigung",
|
||||
message: "Sind Sie sicher?",
|
||||
icon: null,
|
||||
resolve: null,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
open(options = {}) {
|
||||
this.title = options.title || "Bestätigung";
|
||||
this.message = options.message || "Sind Sie sicher?";
|
||||
this.icon = options.icon || null;
|
||||
this.dialogButtons = [
|
||||
{ text: this.$t("yes"), action: this.confirmYes },
|
||||
{ text: this.$t("no"), action: this.confirmNo },
|
||||
];
|
||||
return new Promise((resolve) => {
|
||||
this.resolve = resolve;
|
||||
this.$refs.dialog.open();
|
||||
});
|
||||
},
|
||||
close() {
|
||||
this.$refs.dialog.close();
|
||||
},
|
||||
confirmYes() {
|
||||
console.log('ja');
|
||||
this.resolve(true);
|
||||
this.close();
|
||||
},
|
||||
confirmNo() {
|
||||
console.log('nein');
|
||||
this.resolve(false);
|
||||
this.close();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dialog-body {
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user