mand-mobile/components/toast
xuxiaoyan c39727fb0a test: update mand-mobile introduction 2018-12-21 18:18:05 +08:00
..
demo example: update demos for style 2018-12-03 21:29:22 +08:00
test test: update mand-mobile introduction 2018-12-21 18:18:05 +08:00
README.en-US.md doc(toast, dialog, action-sheet): add prototype methods usage 2018-12-21 10:51:52 +08:00
README.md doc(toast, dialog, action-sheet): add prototype methods usage 2018-12-21 10:51:52 +08:00
component.js feat(code clean up): 2018-09-24 15:48:57 +08:00
index.js test(toast): toast test cases 2018-12-14 16:55:12 +08:00
toast.vue fix(toast): make data change unpredictable to be predictable 2018-12-14 15:31:52 +08:00

README.en-US.md

title preview
Toast https://mand-mobile.github.io/2x-doc/examples/#/toast

Import

import { Toast } from 'mand-mobile'

Toast.succeed('Good Job!')

this.$toast.info('hint') // Totally Import

Instruction

Code Examples

API

Toast Static Methods

Toast({content, icon, iconSvg, duration, position, hasMask, parentNode})

Dynamically create a toast

Props Description Type Default Note
icon name of icon String - refer to Icon component for customized icons
iconSvg use svg icon Boolean false -
content content of message String/Number - -
duration toast will be closed in milliseconds; if set duration as0, the toast will always be visible Number 3000 -
position display position String center top/center/bottom
hasMask whether to show a transparent mask, which will prevent users from clicking Boolean false -
parentNode portal node of toast HTMLElement document.body -
Toast.info(content, duration, hasMask, parentNode)

Dynamically create a text toast

Props Description Type Default Note
content content of message String/Number - -
duration toast will be closed in milliseconds; if set duration as0, the toast will always be visible Number 3000 -
hasMask whether to show a transparent mask, which will prevent users from clicking Boolean false -
parentNode portal node of toast HTMLElement document.body -
Toast.succeed(content, duration, hasMask, parentNode)

Dynamically create a success toast

Props Description Type Default Note
content content of message String/Number - -
duration toast will be closed in milliseconds; if set duration as0, the toast will always be visible Number 3000 -
hasMask whether to show a transparent mask, which will prevent users from clicking Boolean false -
parentNode portal node of toast HTMLElement document.body -
Toast.failed(content, duration, hasMask, parentNode)

Dynamically create a failed toast

Props Description Type Default Note
content content of message String/Number - -
duration toast will be closed in milliseconds; if set duration as0, the toast will always be visible Number 3000 -
hasMask whether to show a transparent mask, which will prevent users from clicking Boolean false -
parentNode portal node of toast HTMLElement document.body -
Toast.loading(content, duration, hasMask, parentNode)

Dynamically create a loading toast

Props Description Type Default Note
content content of message String/Number - -
duration toast will be closed in milliseconds; if set duration as0, the toast will always be visible Number 0 -
hasMask whether to show a transparent mask, which will prevent users from clicking Boolean false -
parentNode portal node of toast HTMLElement document.body -
Toast.hide()

Hide current toast