Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/renoguyon/vuejs-noty
A Vue JS wrapper around Noty
https://github.com/renoguyon/vuejs-noty
Last synced: about 2 months ago
JSON representation
A Vue JS wrapper around Noty
- Host: GitHub
- URL: https://github.com/renoguyon/vuejs-noty
- Owner: renoguyon
- Created: 2017-06-08T20:23:42.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-09-15T15:17:44.000Z (over 2 years ago)
- Last Synced: 2024-03-23T08:42:56.077Z (2 months ago)
- Language: JavaScript
- Size: 76.2 KB
- Stars: 156
- Watchers: 6
- Forks: 29
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Lists
- awesome-vue - vue-noty - A Vue.js 2 wrapper around Noty (Components & Libraries / UI Components)
- awesome-vue - vue-noty - A Vue.js 2 wrapper around Noty (Components & Libraries / UI Components)
- awesome-vue - vue-noty - A Vue.js 2 wrapper around Noty (Components & Libraries / UI Components)
- awesome-vue - vue-noty - A Vue.js 2 wrapper around Noty (Components & Libraries / UI Components)
- awesome-vue - vue-noty - A Vue.js 2 wrapper around Noty (Components & Libraries / UI Components)
- awesome-vue - vue-noty - A Vue.js 2 wrapper around Noty (Components & Libraries / UI Components)
- awesome-vue - vue-noty - A Vue.js 2 wrapper around Noty (Components & Libraries / UI Components)
- awesome-vue - vue-noty - A Vue.js 2 wrapper around Noty (Components & Libraries / UI Components)
- awesome-vue - vue-noty - A Vue.js 2 wrapper around Noty (UI Components / Notification)
- awesome-vue - vue-noty ★93 - A Vue.js 2 wrapper around Noty (UI Components / Notification)
- awesome-vue - vue-noty - A Vue.js 2 wrapper around Noty (UI Components / Notification)
- awesome-vue. - vue-noty - A Vue.js 2 wrapper around Noty (UI Components / Notification)
- awesome-vue - vue-noty - A Vue.js 2 wrapper around Noty (UI Components / Notification)
- awesome-vue - vue-noty - A Vue.js 2 wrapper around Noty (UI Components / Notification)
- awesome-vue - vue-noty - A Vue.js 2 wrapper around Noty (UI Components / Notification)
- awesome-vue - vue-noty - A Vue.js 2 wrapper around Noty (Components & Libraries / UI Components)
- awesome-vue - vue-noty - A Vue.js 2 wrapper around Noty (Components & Libraries / UI Components)
README
# vuejs-noty
A Vue JS wrapper around [Noty](http://ned.im/noty/). Developped for Vue 2.## Getting Started
Install using npm:
```bash
$ npm install vuejs-noty
```Import and register Vue plugin:
```js
import Vue from 'vue'
import VueNoty from 'vuejs-noty'Vue.use(VueNoty)
```#### Import noty styles
Import stylesheet in your vue / js components:
```js
import 'vuejs-noty/dist/vuejs-noty.css'
```Or, import styles in your less / scss stylesheet:
```less
@import '~vuejs-noty/dist/vuejs-noty.css';
```## Usage
In your Vue.js components, simply call one of these methods:
```js
// Basic alert
this.$noty.show("Hello world!")// Success notification
this.$noty.success("Your profile has been saved!")// Error message
this.$noty.error("Oops, something went wrong!")// Warning
this.$noty.warning("Please review your information.")// Basic alert
this.$noty.info("New version of the app is available!")
```All of these methods will return a Noty object instance, so you can use available [API methods](https://ned.im/noty/#/api). Example:
```js
this.$noty.show("Hello world!").setTimeout(4500);
```Create your own notification with access to the [full list of options](https://ned.im/noty/#/options). Example:
```js
this.$noty.create({
text: 'This is a custom notification!',
type: 'warning',
layout: 'topCenter',
timeout: 4500,
progressBar: false
}).show();
```## Configuration
#### Config defaults
You can set a default configuration object when registering the plugin. Example:
```js
Vue.use(VueNoty, {
timeout: 4000,
progressBar: true,
layout: 'topCenter'
})
```#### Config override
All of the alert methods can accept a config object as second parameter if you need to override the defaults. Example:```js
this.$noty.info("Hey! Something very important here...", {
killer: true,
timeout: 6000,
layout: 'topRight'
})
```For more information about available configuration properties, please read [Noty's documentation](https://ned.im/noty/#/options).