pleroma-fe/src/components/confirm_modal/confirm_modal.js

37 lines
732 B
JavaScript
Raw Normal View History

2022-02-09 15:50:25 -05:00
import DialogModal from '../dialog_modal/dialog_modal.vue'
/**
* This component emits the following events:
* cancelled, emitted when the action should not be performed;
* accepted, emitted when the action should be performed;
*
* The caller should close this dialog after receiving any of the two events.
*/
const ConfirmModal = {
components: {
2026-01-06 16:22:52 +02:00
DialogModal,
2022-02-09 15:50:25 -05:00
},
props: {
title: {
2026-01-06 16:22:52 +02:00
type: String,
2022-02-09 15:50:25 -05:00
},
cancelText: {
2026-01-06 16:22:52 +02:00
type: String,
2022-02-09 15:50:25 -05:00
},
confirmText: {
2026-01-06 16:22:52 +02:00
type: String,
},
2022-02-09 15:50:25 -05:00
},
2025-02-05 08:37:00 +02:00
emits: ['cancelled', 'accepted'],
2026-01-06 16:22:52 +02:00
computed: {},
2022-02-09 15:50:25 -05:00
methods: {
2026-01-06 16:22:52 +02:00
onCancel() {
2022-02-09 15:50:25 -05:00
this.$emit('cancelled')
},
2026-01-06 16:22:52 +02:00
onAccept() {
2022-02-09 15:50:25 -05:00
this.$emit('accepted')
2026-01-06 16:22:52 +02:00
},
},
2022-02-09 15:50:25 -05:00
}
export default ConfirmModal