Toast

Import

import { Toast } from  'mand-mobile-next'

Toast.succeed('Good Job!')

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

Vue.createApp().component(Toast.name, Toast) // Component Import

Instruction

Code Examples

API

Toast Static Methods

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

Dynamically create a toast

PropsDescriptionTypeDefaultNote
iconname of iconString-refer to Icon component for customized icons
iconSvguse svg iconBooleanfalse-
contentcontent of messageString/Number--
durationtoast will be closed in milliseconds; if set duration as0, the toast will always be visibleNumber3000-
positiondisplay positionStringcentertop/center/bottom
hasMaskwhether to show a transparent mask, which will prevent users from clickingBooleanfalse-
Toast.info(content, duration, hasMask, parentNode)

Dynamically create a text toast

PropsDescriptionTypeDefaultNote
contentcontent of messageString/Number--
durationtoast will be closed in milliseconds; if set duration as0, the toast will always be visibleNumber3000-
hasMaskwhether to show a transparent mask, which will prevent users from clickingBooleanfalse-
Toast.succeed(content, duration, hasMask, parentNode)

Dynamically create a success toast

PropsDescriptionTypeDefaultNote
contentcontent of messageString/Number--
durationtoast will be closed in milliseconds; if set duration as0, the toast will always be visibleNumber3000-
hasMaskwhether to show a transparent mask, which will prevent users from clickingBooleanfalse-
Toast.failed(content, duration, hasMask, parentNode)

Dynamically create a failed toast

PropsDescriptionTypeDefaultNote
contentcontent of messageString/Number--
durationtoast will be closed in milliseconds; if set duration as0, the toast will always be visibleNumber3000-
hasMaskwhether to show a transparent mask, which will prevent users from clickingBooleanfalse-
Toast.loading(content, duration, hasMask, parentNode)

Dynamically create a loading toast

PropsDescriptionTypeDefaultNote
contentcontent of messageString/Number--
durationtoast will be closed in milliseconds; if set duration as0, the toast will always be visibleNumber0-
hasMaskwhether to show a transparent mask, which will prevent users from clickingBooleanfalse-
Toast.hide()

Hide current toast

Toast.component Props

PropsDescriptionTypeDefaultNote
iconname of iconString-refer to Icon component for customized icons
iconSvguse svg iconBooleanfalse-
contentcontent of messageString/Number--
durationtoast will be closed in milliseconds; if set duration as0, the toast will always be visibleNumber3000-
positiondisplay positionStringcentertop/center/bottom
hasMaskwhether to show a transparent mask, which will prevent users from clickingBooleanfalse-
<md-toast>
  <md-activity-indicator>loading...</md-activity-indicator>
</md-toast>

Toast.component Methods

show()

Show toast

hide()

Hide toast

Toast.component Events

@show()

Toast show event

@hide()

Toast hidden event