mu2.toast
An easy use Toast for Vue.js.
Installation
Prerequisites: Vue.js (>=2.x).
$ npm install mu2.toast
Usage
import Toast from 'mu2.toast'
Vue.use(Toast)
// Use in a vue file
this.$toast({
type: 'loading',
text: 'Loading',
duration: 0
})
// Loading
this.$toast.loading('Loading')
// Or
this.$toast.loading({
text: 'Loading'
})
// Success
this.$toast.success('Success')
// Or
this.$toast.success({
text: 'Success',
duration: 5000
})
// Error
this.$toast.error('Error')
// Or
this.$toast.error({
text: 'Error',
duration: 5000
})
// Warning
this.$toast.warning('Warning')
// Or
this.$toast.warning({
text: 'Warning',
duration: 5000
})
// Toast
this.$toast.toast('Toast')
// Or
this.$toast.toast({
text: 'Toast',
duration: 5000
})
// Dismiss
this.$toast.dismiss()