m-message
A message plugin for vue.
Refer to the implementation of ElementUI message component. Style reference ant-message component.
import Message from 'vue-m-message'
Vue.use(Message) // will mount `Vue.prototype.$message`
Vue.use(Message, {name: 'msg'}) // will mount `Vue.prototype.$msg`
Message API
- Message(options) Show a message
- Massage.info(msg|options)
Infotype message - Massage.success(msg|options)
Successtype message - Massage.error(msg|options)
Errortype message - Massage.warning(msg|options)
Warningtype message - Massage.loading(msg|options)
Loadingtype message
options
| Attribute | Description | Type | Accepted Values | Default |
|---|---|---|---|---|
| options | message options | object | — | — |
| options.type | message type | string | 'info', 'success', 'error', 'warning', 'loading' | info |
| options.message | message content | string | — | '' |
| options.showClose | show close button | false/true | — | false |
| options.onClose | close callback function | function | — | — |
| options.duration | message display duration, unit ms, -1 not closed | number | — | 3000 |
| options.zIndex | z-index | number | — | 1010 |
| options.algin | show position | string | center |