Toasts for Vue 2. (Vue 1)
Install:
npm i vue-toast
Import:
import 'vue-toast/dist/vue-toast.min.css'
import VueToast from 'vue-toast'
new Vue({
template: "<div> <vue-toast ref='toast'></vue-toast> </div>",
components: { VueToast },
mounted() {
const toast = this.$refs.toast
toast.showToast('Show me toast')
toast.showToast('Show me toast again!')
}
})
Global
<link rel="stylesheet" href="./path/to/vue-toast.min.css" charset="utf-8">
<script src='./path/to/vue-toast.min.js'></script>
// it available in window.vueToasts.default
Function setOptions({}) lets to change settings of component.
Function showToast(string, {}) lets to change settings of current toast.
Look here.