Use template to publish Vue.js component(s) as npm module.
Example component included.
0.0.1 Original project setup
0.1.0 Example component added
0.1.1 Level's colors updated
Run
npm install module-template-vue --save
Import
import Flash from 'module-template-vue'
Vue.use(Flash)
Use component
<flash message="Some text"></flash>
<flash :message="{ message: 'Some text', level: 'danger'}"></flash>
To make flash
function available globally turn events
flag on
<flash message="Some text" events="on"></flash>
... and define global events
bus object
window.events = new Vue();
window.flash = function(message) {
window.events.$emit('flash', message);
}
Avalable level flags are: ['success', 'info', 'warning', 'danger']
.