VEUI

VEUI on GitHub
Play!中文

confirm

Installation

import Vue from 'vue'
import { $alert } from 'veui'

Vue.use($alert)

API

After installation, this plugin provides a $confirm method on all component instances, with the following signature: function(content, title, options): Promise<boolean>.

The method returns a Promise object that is resolved when the confirm dialog is successfully closed. If the user clicks the "OK" button, the resolved value is true, otherwise it is false.

NameTypeDescription
contentstringThe text content displayed in the confirm dialog.
titlestringThe title of the confirm dialog.
optionsObject
NameTypeDescription
overlayClassstring | Object | Array<string>The class name(s) to be added to the root node of the confirm dialog overlay.
okfunction(): Promise<void>The function to be called when the "OK" button is clicked. If the Promise returned by this function is resolved, the dialog will be closed, otherwise it will not.
cancelfunction(): Promise<void>The function to be called when the "Cancel" button is clicked. If the Promise returned by this function is resolved, the dialog will be closed, otherwise it will not.
okLabelstringThe text content of the "OK" button.
cancelLabelstringThe text content of the "Cancel" button.
themestringThe theme of the confirm box. Can be 'd20' / 'd22' / 'ai'.
Edit this page on GitHubEdit
© Baidu, Inc. 2024