VEUI

VEUI on GitHub
Play!中文

toast

Installation

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

Vue.use(toast)

API

After installing, this plugin will provide a $toast object on all component instances, which is a function(message, options): void.

NameTypeDescription
messagestringThe text content displayed in the message popup.
optionsObject
NameTypeDefaultDescription
statusstring'info'The type of message, can be 'success' / 'warning' / 'info' / 'error'.
typestring'info'Deprecated. Please use the status property instead.
durationnumber3000Sets the duration in milliseconds before the message disappears.
themestringThe theme of the toast. Can be 'd20' / 'd22' / 'ai'.

The $toast method also provides the following shortcut methods, which will set the status value of options to the corresponding value:

Method NameTypeDescription
successfunction(message, options): voidDisplays a message with the "success" status.
warnfunction(message, options): voidDisplays a message with the "warning" status.
infofunction(message, options): voidDisplays a message with the "normal message" status.
errorfunction(message, options): voidDisplays a message with the "error" status.
Edit this page on GitHubEdit
© Baidu, Inc. 2024