An easy use Toast for Vue.js.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
src
.babelrc
.editorconfig
.gitattributes
.gitignore
.npmignore
.postcssrc.js
.travis.yml
LICENSE
README.md
index.html
package.json
webpack.config.js
yarn.lock

README.md

mu2.toast

An easy use Toast for Vue.js.

mu2.toast

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()