Modals
Any important stuff you don't want to be missed by a user can be shown with modal windows. Each modal window is a special component within src/components/modals
directory.
Modals can be triggered from any component with:
this.$modal.open(name: String, props: Object, size: String): Promise
- opens a modal window fromsrc/components/modals/**name**.vue
with window size fromsize
('sm'
to shrink window or'lg'
to widen it), passes component props fromprops
. Returns a promise resolving after modal is closed.this.$modal.close([data: Any])
- close current modal and resolve its promise with optionaldata
.
All modals can be closed automatically without any provided data after user:
- clicked outside a modal window
- pressed ESC
Also current modal will be closed without resolving if other modal is opened.
Available modal windows
Modal windows available out-of-the-box are described here. See custom modal windows section if you want to add a custom modal widnow.
confirm
Action confirmation with 2 buttons to accept or decline some action.
Props:
title
- modal title, default:confirmDialog
translation message entry ('Are you sure?' foren
)yes
- accept button text, defaultyes
translation message entry ('Yes' foren
)no
- decline button text, defaultno
translation message entry ('No' foren
)text
- modal window body content, bodyless window by default
Resolved with true
or false
depending on user decision.
error
Just error message with red decorations and single button.
title
- modal title, default:error
translation message entry ('Error' foren
)button
- button text, defaultok
translation message entry ('OK' foren
)text
- modal window body textjsonData
- object, shown as a pretty JSON.
Resolved without any data.
success
Just success message with green decorations and single button.
title
- modal title, default:done
translation message entry ('Done' foren
)button
- button text, defaultok
translation message entry ('OK' foren
)text
- modal window body text
Resolved without any data.