Confirm #
A simple modal with message and ok and cancel buttons. Returns promise with true
if ok clicked and false
if cancel is clicked.
export default {
methods: {
onButtonClick() {
this.$vaModal.confirm('Are you sure you want to see standard alert?')
.then((ok) => ok && alert('This is standard browser alert'))
},
},
}
Props #
Any prop from VaModal can be passed to confirm. Event listeners can be passed with on
prefix. For example, onClickOutside
.
Name | Description | Types | Default |
---|---|---|---|
allowBodyScroll |
|
| |
anchorClass |
| - | |
ariaCloseLabel |
|
| |
attachElement |
|
| |
backgroundColor |
|
| |
beforeClose |
| - | |
blur |
|
| |
cancelText |
|
| |
disableAttachment |
|
| |
fixedLayout |
|
| |
fullscreen |
|
| |
hideDefaultActions |
|
| |
maxHeight |
|
| |
maxWidth |
|
| |
message |
|
| |
mobileFullscreen |
|
| |
modelValue |
|
| |
noDismiss |
|
| |
noEscDismiss |
|
| |
noOutsideDismiss |
|
| |
noPadding |
|
| |
okText |
|
| |
onBeforeClose | Function to be called before closing |
| |
onBeforeOpen | Function to be called before opening |
| |
onCancel | Function to be called after cancel button is been pressed |
| |
onClickOutside | Function to be called after clicking outside the modal |
| |
onClose | Function to be called after closing |
| |
onOk | Function to be called after pressing the "ok" button |
| |
onOpen | Functiong to be called after opening the modal |
| |
overlay |
|
| |
overlayOpacity |
|
| |
size |
|
| |
stateful |
|
| |
title |
|
| |
withoutTransitions |
|
| |
zIndex |
| - |
Events #
Name | Description |
---|---|
beforeClose | Emits before modal's start closing after transition started |
beforeOpen | Emits before modal's open after transition started |
cancel | Emits when the user closes the modal window without side effects |
clickOutside | Emits when overlay is clicked |
close | Emits when modal's is closed and transition is complete |
ok | Emits when Ok button is clicked |
open | Emits when modal's is open and transition is complete |
update:modelValue | The event is triggered when the component needs to change visibility |