universal-toast

v0.2.9
A universal Toast API.


title: toast

universal-toast npm

Universal toast, you can choose how many seconds after disappearing

Support

browser miniApp wechatMiniprogram bytedanceMicroApp

Install

$ npm install universal-toast --save

Usage

import Toast from 'universal-toast';

Toast.show('Hi');

Methods

Toast.show(options: object | string)

Arguments

Property Type Description Default
message string content of the message -
type `success fail none`
duration number Time in millisecond before Toast is closed. 2000
success function The callback function for a successful API call -
fail function The callback function for a failed API call -
complete function The callback function used when the API call completed (always executed whether the call succeeds or fails) -

Toast.hide()

Hides the loading prompt box

Metadata

Downloads

Maintainers