Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://hiyali.github.io/awesome-vue-toast/

:whale: awesome vue2 simple toast
https://hiyali.github.io/awesome-vue-toast/

singleton toast vue-toast vue2 vue2-toast webpack

Last synced: about 2 months ago
JSON representation

:whale: awesome vue2 simple toast

Awesome Lists containing this project

README

        

# awesome-vue-toast
:whale: awesome vue2 simple toast

[![npm package](https://img.shields.io/npm/v/awesome-vue-toast.svg)](https://www.npmjs.com/package/awesome-vue-toast)

* Can be singleton
* Programmable

Changed from [AStaroverov/vue-toast](https://github.com/AStaroverov/vue-toast)

## Example

[Live demo](https://hiyali.github.io/awesome-vue-toast)

### Screenshot

![screenshot](https://raw.githubusercontent.com/hiyali/awesome-vue-toast/master/assets/toast-screenshot.png "screenshot")

## Install

```shell
npm i -S awesome-vue-toast
```

## Usage
```javascript
import Toast from 'awesome-vue-toast'
...
Toast.showToast('Enjoy toast!')
```

### Singleton

```html

...


...
Toast.showToast('Enjoy toast!')
...

...

```

## Option
```javascript
Toast.addMessage({
text: 'This is success type',
type: 'success',
dismissAfter: 3 * 1000
})
```

| option | type | default | other value |
| :------------- | :--------- | :------------ | :----------- |
| `text` | `String` | | |
| `type` | `String` | info | success, warning, danger |
| `dismissAfter` | `Int` | 5 * 1000 | milliseconds |

## Development / build
```shell
npm run dev # development
npm run build # build
```

## For customization props

| props | default | other value | description |
| :------------ | :--------- | :------------- | :------------- |
| `position` | se | n, s, nw, ne, sw, se | north, south, north west, ... |