Muse-UI-Message
Muse-UI plugin message dialog
Installation
npm install -S muse-ui-message// oryarn add muse-ui-message
CDN
Usage
;;;Vue; methods: { this; this; this; } // orMuseUIMessage;MuseUIMessage;MuseUIMessageprompt'Input Some I'; // use with router router;
API
config
successIcon: 'check_circle' // success icon infoIcon: 'info' // info icon warningIcon: 'priority_high' // warning icon errorIcon: 'warning' // error icon iconSize: 24 // icon size width: 350 // dialog width maxWidth: '80%' // dialog max width className: '' // dialog class okLabel: '确定' // dialog ok label cancelLabel: '取消' // dialog cancel label transition: 'scale' // 'slide-top', 'slide-bottom', 'slide-left', 'slide-right', 'fade', 'scale';
config (config)
Change default config, Will return new config.
Methods
- $alerts(content, title, options) 或 $alerts(content, options)
- $confirm(content, title, options) 或 $confirm(content, options)
- $prompt(content, title, options) 或 $prompt(content, options)
Will return Promise, ({ resule, value })
this
Options
Name | Description | Type | Accepted Values | Default |
---|---|---|---|---|
title | dialog title | String | — | — |
content | dialog content, support render function | String, Function | — | — |
mode | dialog mode | String | alert / confirm / prompt | alert |
type | dailog level type | String | success / info / error / warning | — |
icon | dialog icon | String | — | — |
iconSize | icon size | Number | — | 24 |
width | dialog width | Number / String | — | 350 |
maxWidth | max width | Number / String | — | 80% |
className | dialog class | String | — | — |
transition | transition animate | String | slide-top / slide-bottom / slide-left / slide-right / fade / scale | scale |
beforeClose | before close callback (result, instance, done) | Function | — | — |
okLabel | ok button label | String | — | — |
cancelLabel | cancel button label | String | — | — |
inputType | input type | String | — | — |
inputPlaceholder | input placeholder | String | — | — |
inputValue | input default value | String | — | — |
validator | input validator function (val), will return { valid, message } | Function | — | — |
Dependencies Muse-UI
mu-dialog
mu-icon
mu-text-field
mu-button
Licence
muse-ui-message is open source and released under the MIT Licence.
Copyright (c) 2018 myron