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
.
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
content | string | The text content displayed in the prompt. | ||||||||||||
title | string | The title of the prompt. | ||||||||||||
options | Object |
| ||||||||||||
okLabel | string | The text content of the "OK" button. | ||||||||||||
cancelLabel | string | The text content of the "Cancel" button. |