mand-mobile/components/toast
MeloHG 43c3ab0127 fix(site): 修复 Toast 文档展示问题 2022-08-26 18:09:46 +08:00
..
demo feat(taost): 增加 types 2022-08-10 16:29:56 +08:00
test Bump up version to 2.6.0-beta.3 2021-10-11 14:37:36 +08:00
README.en-US.md fix(site): 修复 Toast 文档展示问题 2022-08-26 18:09:46 +08:00
README.md fix(site): 修复 Toast 文档展示问题 2022-08-26 18:09:46 +08:00
component.js
index.js fix: 修复部分组件找不到 vue 文件问题 2022-07-28 16:54:22 +08:00
toast.vue fix(toast): 调整方形 Toast 中 icon 大小及间距 2022-08-10 16:30:59 +08:00

README.en-US.md

title preview
Toast https://didi.github.io/mand-mobile/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, square})

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 -
square 2.6.0+ use square style Boolean false -
Toast.info(content, duration, hasMask, parentNode, square)

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 -
square 2.6.0+ use square style Boolean false -
Toast.succeed(content, duration, hasMask, parentNode, square)

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 -
square 2.6.0+ use square style Boolean false -
Toast.failed(content, duration, hasMask, parentNode, square)

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 -
square 2.6.0+ use square style Boolean false -
Toast.loading(content, duration, hasMask, parentNode, square)

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 -
square 2.6.0+ use square style Boolean false -
Toast.hide()

Hide current toast

Toast Props

2.3.0+

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 -
square 2.6.0+ use square style Boolean false -

Toast Slots

default

<md-toast>
  <md-activity-indicator>loading...</md-activity-indicator>
</md-toast>

Toast Methods

2.3.0+

show()

Show toast

hide()

Hide toast

Toast Events

2.3.0+

@show()

Toast show event

@hide()

Toast hidden event