# vue-toast-plugin

> A simple toast plugin for Vue.js

Latest version **1.0.2** (published 2017-10-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-toast-plugin
pnpm add vue-toast-plugin
yarn add vue-toast-plugin
bun add vue-toast-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-10-13 |
| First published | 2017-07-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 4.0.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | zhangzongzheng |
| Maintainers | bourne |
| Keywords | vue, toast |

## Links

- npm: https://www.npmjs.com/package/vue-toast-plugin
- Repository: https://github.com/ihaichao/vue-toast-plugin
- Homepage: https://github.com/ihaichao/vue-toast-plugin#readme
- Issues: https://github.com/ihaichao/vue-toast-plugin/issues
- npm.io page: https://npm.io/package/vue-toast-plugin

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2017-10-13
- 1.0.1 — 2017-07-10
- 1.0.0 — 2017-07-07

## README

# Vue-Toast-Plugin

[![Build Status](https://travis-ci.org/ihaichao/vue-toast-plugin.svg?branch=master)](https://travis-ci.org/ihaichao/vue-toast-plugin)
[![NPM Version](https://img.shields.io/badge/npm-v1.0.1-blue.svg)](https://www.npmjs.com/package/vue-toast-plugin)

A simple toast plugin for Vue.js.

## Demo

[Demo](https://ihaichao.github.io/vue-toast-plugin)

## Features

- Supports both Vue 1.x and 2.x
- Simple

## Installation

```Bash
npm i vue-toast-plugin
```

## Usage

> Need to use with webpack because css is imported in js for convenient.

index.js

```javascript
import Vue from 'vue'
import Toast from 'vue-toast-plugin'

Vue.use(Toast)
```

App.vue

```javascript
export default {
  methods: {
    success () {
      this.$toast(this.$refs.success, 'Wonderful!', 'success')
    },

    warning () {
      this.$toast(this.$refs.warning, 'Attention!', 'warning', 3000)
    },

    info () {
      this.$toast(this.$refs.info, 'Infomation!', 'info', 1000, 100)
    },

    error () {
      this.$toast(this.$refs.error, 'Opps!', 'error', 2000, 500, 600)
    }
  }
}
```

## Options

|Option|Description|Value|Default|
|---|---|---|---|
|el|target element|||
|text|content of the toast|||
|type|type of the toast|'success' 'warning' 'info' 'error'||
|duration|time before the toast vanishes, in millisecond||4000
|top|the distance between the top of the body and the toast element, in px||right of the target element
|left|the distance between the left of the body and the toast element, in px||bottom of the target element

## License

MIT

---
_Source: https://npm.io/package/vue-toast-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
