1.1.1 • Published 2 years ago

@uni/toast v1.1.1

Weekly downloads
65
License
BSD-3-Clause
Repository
github
Last release
2 years ago

toast

npm

Universal toast, you can choose how many seconds after disappearing

Support

Install

$ npm install @uni/toast --save

Usage

import { showToast, hideToast } from '@uni/toast';

showToast('Hi');

hideToast();

Methods

showToast(options: object | string)

Arguments

PropertyTypeDescriptionDefault
contentstringcontent of the message-
typestringType of popupnone
durationnumberTime in millisecond before Toast is closed.2000
successfunctionThe callback function for a successful API call-
failfunctionThe callback function for a failed API call-
completefunctionThe callback function used when the API call completed (always executed whether the call succeeds or fails)-

Valid type

ValueDescriptionSupportNo Support
successShow success icon
failShow fail icon
loadingShow loading icon
noneNo icon

Special Arguments

PropertyTypeDescriptionDefaultSupport
imagestringThe local path of the custom icon, the priority of image is higher than icon-
maskbooleanWhether to display a transparent mask to prevent touch penetrationnone

hideToast()

Hides the loading prompt box