Skip to content

Dialog

A secondary encapsulation of the element-plus dialog component.

Basic Usage

Asynchronous Loading Indicator

Properties

PropertyDescriptionTypeDefaultExpandable
model-value / v-modelWhether to display the DialogbooleanfalseNo
cancel-textText for the cancel button, hidden if emptystringCancelYes
confirm-textText for the confirm button, hidden if emptystringConfirmYes
loadingDisplay loading layer during asynchronous operationsbooleanfalseYes
widthWidth of the dialog, default is 50%enum800Yes
destroy-on-closeDestroy elements inside the Dialog when closedbooleantrueYes
close-on-click-modalWhether the Dialog can be closed by clicking the modal backgroundbooleanfalseYes
close-on-press-escapeWhether the Dialog can be closed by pressing ESCbooleanfalseYes
titleTitle of the Dialog, can also be passed in through a named slotstring''No
fullscreenWhether the Dialog should be fullscreenbooleanfalseNo
topThe margin-top value in dialog CSS, default is 15vhstring''No
modalWhether a modal overlay is neededbooleantrueNo
modal-classCustom class for the modal overlaystringNo
append-to-bodyWhether the Dialog itself should be appended to the body element. Nested Dialogs must specify this property and set it to truebooleanfalseNo
append-toWhich DOM element the Dialog is mounted to, overrides append-to-body (Version: 2.4.3)stringbodyNo
lock-scrollWhether to lock body scroll when the Dialog is displayedbooleantrueNo
open-delayDelay in opening the Dialog, in millisecondsnumber0No
close-delayDelay in closing the Dialog, in millisecondsnumber0No
show-closeWhether to display the close buttonbooleantrueNo
before-closeCallback before closing, will pause Dialog closure. The dialog is truly closed when the done method within the callback is called.FunctionNo
draggableEnable drag functionality for the DialogbooleanfalseNo
overflowDragging range can exceed the visible areabooleanfalseNo
centerWhether to center the Dialog's header and footer partsbooleanfalseNo
align-centerWhether to horizontally and vertically align the DialogbooleanfalseNo
close-iconCustom close icon, default is CloseenumNo
z-indexz-index of the Dialog, same as native CSS z-index, changes the z-axis ordernumberNo
header-aria-levelARIA level for the headerstring2No

Slots

Slot NameDescriptionType
Content of the Dialog-
headerContent of the dialog header; replaces the header part but does not remove the close button.-
footerContent of the Dialog button operation area-

Events

Event NameDescriptionTypeExpandable
cancelCallback for the cancel buttonFunctionYes
confirmCallback for the confirm buttonFunctionYes
openCallback when the Dialog opensFunctionNo
openedCallback when the Dialog open animation endsFunctionNo
closeCallback when the Dialog closesFunctionNo
closedCallback when the Dialog close animation endsFunctionNo
open-auto-focusCallback when focus is in the Dialog contentFunctionNo
close-auto-focusCallback when focus moves out of the Dialog contentFunctionNo

Released under the MIT License