1
1
mirror of https://github.com/aelve/guide.git synced 2024-12-27 15:41:18 +03:00
guide/front/client/components/ConfirmDialog.vue

55 lines
1.1 KiB
Vue
Raw Normal View History

<!-- Universal confirmation dialog, just pass text and function in Props -->
<template>
<v-dialog
:value="value"
@input="close"
max-width="500px"
>
<slot slot="activator" />
<v-card>
<v-card-text>
Are you sure you want to {{ confirmationText }}
</v-card-text>
<v-divider />
<v-card-actions>
<v-spacer />
<v-btn
flat
color="primary"
class="confirm-btn"
@click.native="confirmAction(itemId); close"
>
Continue
</v-btn>
<v-btn
flat
color="primary"
@click.native="close"
>
Cancel
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script lang="ts">
import Vue from 'vue'
import Component from 'vue-class-component';
import { Prop } from 'vue-property-decorator';
@Component
export default class ConfirmDialog extends Vue {
@Prop(String) confirmationText!: string
@Prop(Function) confirmAction!: Function
@Prop(Boolean) value!: boolean
@Prop(String) itemId!: string
close() {
this.$emit('input', false)
}
}
</script>