1.1.1 • Published 6 years ago

vue-component-toast v1.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

vue-component-toast

Install

$ npm install --save vue-component-toast

Usage

Npm

import toast from 'vue-component-toast'
import 'vue-component-toast/dist/css/vc-toast.min.css'

// Vue.use(toast, [<global-option>])
Vue.use(toast)

// Vue property
Vue.$toast('this is the prompt message.')

// Vue instance property
vm.$toast({ message: 'this is the prompt message.' })

Script

// Vue.use(window['vc-toast'], [<global-option>])
Vue.use(window['vc-toast'])

// Vue property
Vue.$toast('this is the prompt message.')

// Vue instance property
vm.$toast({ message: 'this is the prompt message.' })

API

Grammar:

  • Vue.$toast(\ | \): toast
  • vm.$toast(\ | \): toast

Option

ParameterTypeDefault valueOptional valueDescription
messageStringThe prompt message
positionString'middle''top', 'middle', 'bottom'The location of the toast
durationNumber3000If it is less than or equal to 0, it means you need to close it manually
classNameStringThe class name of Toast. You can add styles to it
iconClassStringThe class name of the icon icon
overrideBooleantrueOverrides the prompt for the specified location
maskBooleanfalseNo page interaction

Toast

Instance methods

  • toast.close(): Close the toast prompt

License

MIT

1.1.1

6 years ago

1.1.0

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago