0.4.0 • Published 6 years ago

vue-roast v0.4.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Demo

Install

Via npm

npm i vue-roast

Register plugin

import VueRoast from 'vue-roast';

Vue.use(VueRoast, config);

Config

PropTypeDescriptionDefaultPossible
ttlNumberDefault toast message ttl5000
thresholdNumber | BooleanMax number of displayed toasts at a time (false to disable)3
positionStringPosition of toast messages'bottom-left''top', 'bottom' - 'left', 'middle', 'right'

API

In component:

this.$toast(message, options);

Outside of component

Vue.toast(message, options);

Message

PropTypeDefaultPossible
titleString''
bodyString''
footerString''
levelString'info''info', 'warning', 'error'

Options

PropTypeDescription
ttlNumberToast message display time in miliseconds
truncateAfterNumberMax message char length to display
actionObjectAction triggered on toast click
action.placeholderStringAction placeholder
action.methodStringMethod to be invoked on click

Tests

npm test

Contributing

Please follow selected coding style guide. Add unit tests for any new or changed functionality. Lint and test your code.