VEUI

VEUI on GitHub
Play!中文

prompt

Installation

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

Vue.use($prompt)

API

After installation, this plugin will provide a $prompt method on all component instances, with the type of function(content, title, options): Promise<?string>.

This method returns a Promise object that will be resolved after the prompt is successfully closed. If the user clicks the "OK" button, the resolved result will be the string entered by the user; if the "Cancel" button is clicked, the result value will be null.

NameTypeDescription
contentstringThe text content displayed in the prompt.
titlestringThe title of the prompt.
optionsObject
NameTypeDescription
overlayClassstring | Object | Array<string>The class name added to the root node of the prompt.
okfunction(): Promise<void>Inserts an asynchronous process before the Promise returned by the success method is resolved after clicking the "OK" button. If the Promise returned by this function is resolved, the prompt will be closed; otherwise, it will remain open.
cancelfunction(): Promise<void>Inserts an asynchronous process before the Promise returned by the success method is resolved after clicking the "Cancel" button. If the Promise returned by this function is resolved, the prompt will be closed; otherwise, it will remain open.
okLabelstringThe text content of the "OK" button.
cancelLabelstringThe text content of the "Cancel" button.
themestringThe theme of the prompt box. Can be 'd20' / 'd22' / 'ai'.
Edit this page on GitHubEdit
© Baidu, Inc. 2024