You can use it on Vuex or VueRouter using this syntax:
Dialog
Dialogs inform users about a specific task and may contain critical information or require decisions
# Alert
# Confirm
# Prompt
# From outside Vue instance
# Promise
You can set defaultProgrammaticPromise
constructor option to get a Promise
# API
Name | Description | Type | Values | Default |
---|---|---|---|---|
type | Type (color) of the confirm button (and the icon if hasIcon ) | String | is-white , is-black , is-light ,
is-dark , is-primary , is-info , is-success ,
is-warning , is-danger ,
and any other colors you've set in the $colors list on Sass | is-primary |
title | Dialog title | String | — | — |
message | Message text (can contain HTML). Dynamically rendering arbitrary HTML on your website can be very dangerous because it can easily lead to XSS vulnerabilities. Only use HTML interpolation on trusted content and never on user-provided content. | String, Array | — | — |
hasIcon | Adds an icon on the left side depending on the type or icon | Boolean | — | false |
icon | Icon name if hasIcon , optional | String | — | — |
iconPack | Icon pack to use if hasIcon , optional | String | mdi , fa , fas , far , fad , fal | — |
size | Dialog's size, optional | String | is-small , is-medium , is-large | — |
animation | Custom animation (transition name) | String | — | zoom-out |
confirmText | Text of the confirm button | String | — | OK |
cancelText | Text of the cancel button | String | — | Cancel |
canCancel | Can close dialog by clicking cancel button, pressing escape or clicking outside | Boolean, Array | escape , button , outside | true for Confirm/Prompt, false for Alert |
inputAttrs | Prompt only: input's attributes | Object | Any HTML5 input attribute | — |
onConfirm | Callback function when the confirm button is clicked | Function (value: String, dialog: VueInstance) | — | — |
closeOnConfirm | Turning this prop into false allows to make async requests in onConfirm callback | Boolean | true , false | true |
onCancel | Callback function when the dialog is canceled (cancel button is clicked / pressed escape / clicked outside) | Function | — | — |
scroll | clip to remove the <body> scrollbar, keep to have a non scrollable scrollbar
to avoid shifting background, but will set <body> to position fixed, might break some layouts | String | clip , keep | clip |
container | DOM element the dialog will be created on. Note that this also changes the position of the dialog from fixed to absolute . Meaning that the container should be fixed . Also note that this will override the defaultContainerElement if you specified it in your Buefy Constructor Options. See Constructor options for more details. | String | — | body |
focusOn | Focus on confirm or cancel button (when dialog is not prompt) | String | confirm , cancel | confirm |
trap-focus | Trap focus inside the dialog. | Boolean | — | true |
aria-role | Role attribute to be passed to modal container for better accessibility. | String | dialog , alertdialog | — |
aria-modal | Improve accessiblity when enabled. | Boolean | — | false |
This page is open source. Noticed a typo or something's unclear?