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 of the cancel button; pass an empty string to hide the button; defaults to the locale fallback (see Quick Start - Internationalization)stringCancel (locale fallback)Yes
confirm-textText of the confirm button; pass an empty string to hide the button; defaults to the locale fallback (see Quick Start - Internationalization)stringConfirm (locale fallback)Yes
loadingDisplay loading layer during asynchronous operationsbooleanfalseYes
widthWidth of the dialog, 50% by default in Element Plus, fixed to 800 by this componentenum800Yes
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 overlaystring—No
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.Function—No
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 Closeenum—No
z-indexz-index of the Dialog, same as native CSS z-index, changes the z-axis ordernumber—No
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 ​

This component supports all native events of Element Plus Dialog. All events are automatically forwarded to the underlying el-dialog component.

Extended Events:

Event NameDescriptionTypeExpandable
cancelCloses the dialog and fires when the cancel button is clickedFunctionYes
confirmFires when the confirm button is clicked; the dialog does not close automatically, control it via v-modelFunctionYes

Element Plus Native Event Examples:

Event NameDescriptionType
openCallback when the Dialog opensFunction
openedCallback when the Dialog open animation endsFunction
closeCallback when the Dialog closesFunction
closedCallback when the Dialog close animation endsFunction
open-auto-focusCallback when focus is in the Dialog contentFunction
close-auto-focusCallback when focus moves out of the Dialog contentFunction

💡 Multi-version Compatibility: Supports all Element Plus 2.x versions, including future events that will be automatically available.

Released under the MIT License