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'))
    },
  },
}
Open in GitHub

Props
#

Any prop from VaModal can be passed to confirm. Event listeners can be passed with on prefix. For example, onClickOutside.

Open in GitHub
NameDescriptionTypesDefault
allowBodyScroll

Boolean

false

anchorClass

String

-

ariaCloseLabel

String

"$t:close"

attachElement

String

"body"

backgroundColor

String

"background-secondary"

beforeClose

Function

-

blur

Boolean

false

cancelText

String

"$t:cancel"

disableAttachment

Boolean

false

fixedLayout

Boolean

false

fullscreen

Boolean

false

hideDefaultActions

Boolean

false

maxHeight

String

""

maxWidth

String

""

message

String

""

mobileFullscreen

Boolean

true

modelValue

Boolean

false

noDismiss

Boolean

false

noEscDismiss

Boolean

false

noOutsideDismiss

Boolean

false

noPadding

Boolean

false

okText

String

"$t:ok"

onBeforeClose

Function to be called before closing

Function

onBeforeOpen

Function to be called before opening

Function

onCancel

Function to be called after cancel button is been pressed

Function

onClickOutside

Function to be called after clicking outside the modal

Function

onClose

Function to be called after closing

Function

onOk

Function to be called after pressing the "ok" button

Function

onOpen

Functiong to be called after opening the modal

Function

overlay

Boolean

true

overlayOpacity

Number | String

0.6

size

String

"medium"

stateful

Boolean

false

title

String

""

withoutTransitions

Boolean

false

zIndex

Number | String

-

Events #

NameDescription

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