Socket
Socket
Sign inDemoInstall

vue-toast

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue-toast

toasts for vuejs


Version published
Weekly downloads
550
decreased by-9.84%
Maintainers
1
Install size
182 kB
Created
Weekly downloads
 

Readme

Source

vue-toast

Toasts for Vue 2. (Vue 1)

How does it work? Look it here.

Usage

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

API

  • showToast(string, {}) - main function that generates toast with some settings of instance toast and shows him.
  • setOptions({}) - function for changing settings of component.
  • closeAll({}) - function for close all toasts.

Settings

Funcion setOptions({}) lets to change settings of component.

  • position {String} position of component | default: 'left bottom' | possible '[left, right] [top, bottom]'
  • maxToasts {Number} max toasts number | default: 6

Funcion showToast(string, {}) lets to change settings of current toast.

  • theme {String} style for toast | default: default | possible: info warning error success
  • timeLife {Number} time of life for current toast
  • closeBtn {Boolean} turn off|on button for close toast and disabled|enabled "timeLife"

Example

Look here.

Keywords

FAQs

Last updated on 02 May 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc