Skip to content
Snippets Groups Projects
Commit bb50ce1f authored by Julian's avatar Julian
Browse files

Create generic confirmation dialog

parent 9cb8cd39
No related branches found
No related tags found
1 merge request!1304Refactor calendar overview in more different components
<script>
import {defineComponent} from 'vue'
import CancelButton from "../buttons/CancelButton.vue";
import PrimaryActionButton from "../buttons/PrimaryActionButton.vue";
export default defineComponent({
name: "ConfirmDialog",
components: {PrimaryActionButton, CancelButton},
props: {
value: {
type: Boolean,
required: true,
},
},
methods: {
confirm() {
console.log("Confirming");
this.$emit("confirm");
this.$emit("input", false);
},
cancel() {
console.log("Cancelling");
this.$emit("cancel");
this.$emit("input", false);
},
},
})
</script>
<template>
<v-dialog :value="value" @click:outside="cancel" max-width="400">
<v-card>
<v-card-title>
<slot name="title"></slot>
</v-card-title>
<v-card-text>
<slot name="text"></slot>
</v-card-text>
<v-card-actions>
<cancel-button @click="cancel">
<slot name="cancel"></slot>
</cancel-button>
<v-spacer></v-spacer>
<primary-action-button @click="confirm" i18n-key="actions.confirm">
<slot name="confirm"></slot>
</primary-action-button>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<style scoped>
</style>
......@@ -76,6 +76,7 @@
"cancel": "Abbrechen",
"clear_filters": "Filter zurücksetzen",
"close": "Schließen",
"confirm": "Bestätigen",
"confirm_deletion": "Sind Sie sicher, dass Sie dieses Objekt löschen wollen?",
"confirm_deletion_multiple": "Sind Sie sicher, dass Sie diese Objekte löschen wollen?",
"copied": "Kopiert",
......
......@@ -77,6 +77,7 @@
"back": "Back",
"cancel": "Cancel",
"close": "Close",
"confirm": "Confirm",
"confirm_deletion": "Are you sure you want to delete this item?",
"confirm_deletion_multiple": "Are you sure you want to delete these items?",
"delete": "Delete",
......
  • Julian @ZugBahnHof

    mentioned in commit e7eaedc7

    ·

    mentioned in commit e7eaedc7

    Toggle commit list
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment