More Details in api docs :)
Some examples are following:
only title
and msg
.
import vueAlert from '../src'
vueAlert({
title: 'OverWatch',
msg: 'The World Needs Heros',
})
you can specify the align
property to align text.
vueAlert({
title: 'OverWatch',
msg: 'The World Needs Heros',
align: 'center', // add this!
})
There are 2 types, each type has its icon. sccuess
(ok icon) and error
(error icon).
Besides, you can overrride the default icon, by specifying icon
property.
// success
vueAlert({
type: 'success', // or 'error'
msg: 'The World Needs Heros',
align: 'center',
})
If you like, you can add some listeners for some events. e.g. onClickYesBtn
.
vueAlert({
msg: 'The World Needs Heros',
align: 'center',
needNoBtn: true,
onClickYesBtn() {
console.log('Hello World')
}, // add this!
// onClickNoBtn() {}
// cbWhenClickMask() {}
})
Customize some default styles by style
prop.
vueAlert({
title: 'OverWatch',
msg: 'The World Needs Heros',
style: {
box: {
padding: '5px',
borderRadius: '10px',
bgColor: '#313131',
},
textColor: '#fff',
},
})
There some 3 types of animation.
vueAlert({
title: 'OverWatch',
msg: 'The World Needs Heros',
animate: 'bound', // fade, bound, slide
})