diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2023-01-25 23:49:16 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2023-01-25 23:49:16 +0000 |
| commit | 65e10f07def87f0c4399dbce92eb00b430d5dba4 (patch) | |
| tree | 02d8646054b4f3647cee9938d82c2e9e3a70312b /src/components/confirm_modal/confirm_modal.js | |
| parent | a9716701be26c696ee1b908a1787b34880175ffa (diff) | |
| parent | c7c68340f1c8838cead855de3f624e0796fbc6c7 (diff) | |
Merge branch 'from/develop/tusooa/confirm-dialogs' into 'develop'
Confirmation dialogs
See merge request pleroma/pleroma-fe!1431
Diffstat (limited to 'src/components/confirm_modal/confirm_modal.js')
| -rw-r--r-- | src/components/confirm_modal/confirm_modal.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/components/confirm_modal/confirm_modal.js b/src/components/confirm_modal/confirm_modal.js new file mode 100644 index 00000000..96ddc118 --- /dev/null +++ b/src/components/confirm_modal/confirm_modal.js @@ -0,0 +1,37 @@ +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: { + DialogModal + }, + props: { + title: { + type: String + }, + cancelText: { + type: String + }, + confirmText: { + type: String + } + }, + computed: { + }, + methods: { + onCancel () { + this.$emit('cancelled') + }, + onAccept () { + this.$emit('accepted') + } + } +} + +export default ConfirmModal |
