import Vue from 'vue';
import { VueToast } from '@kashio/vue-toast';
import '@kashio/vue-toast/dist/index.css';
Vue.use(VueToast);
Vue.maxToasts = 10;
const vm = new Vue({
el: '#app',
render: h => h('button', {
style: {
position: 'relative',
top: '20px',
left: '20px'
},
on: {
click() {
vm.$toast({
message: 'Hello World',
borderRadius: 7,
color: 'black',
backgroundColor: '#e2eef9',
fixedWidth: 300,
closeButton: true,
time: 5000
});
}
}
}, 'Launch Toast')
});
export default vm;
fade
- Fade speed (Number
|String
). Defaults toslow
(see jQuery fade values).position
- Toast position (String
). Eitherbottom left
,bottom right
,top left
, ortop right
. Defaults tobottom right
.borderRadius
- Toast border radius (Number
|String
). Defaults to0
.message
- Toast message (string
).color
- Toast message color (string
). Defaults torgb(255, 255, 255)
.backgroundColor
- Toast background color (string
). Defaults torgba(60, 118, 61, 0.9)
.closeButton
- Show close button (Boolean
). Takes priority overtime
.time
- Time in milliseconds before toast disappears (Number
). Defaults to3000
.fixedWidth
- Width of the toast (Number
|String
).
Run tests with
$ npm test
vue-toast is licensed under the GPL V3 License.