Noty for VueJs (incl. FontAwesome Support)
A VueJS 2 wrapper around Noty.
Forked to add FontAwesome support.
Getting Started
Install using npm:
$ npm install vuejs-noty-fa
Import and register Vue plugin:
Vue
For use with Nuxt, create a new plugin:
// /plugins/noty.js { Vue}
.. and add it to nuxt.config.js
plugins: src: '@/plugins/noty' ssr: false
Import noty styles
Import stylesheet in your vue / js components:
Or, import styles in your less / scss stylesheet:
'~vuejs-noty-fa/dist/vuejs-noty-fa.css';
Or, import styles for Nuxt inside nuxt.config.js
:
css: 'vuejs-noty-fa/dist/vuejs-noty-fa.css'
Usage
In your Vue.js components, simply call one of these methods:
// Basic alertthis$noty // Success notificationthis$noty // Error messagethis$noty // Warningthis$noty // Basic alertthis$noty // Close all alertsthis$noty
All of these methods will return a Noty object instance, so you can use available API methods.
Configuration
Config defaults
You can set a default configuration object when registering the plugin. Example:
Vue
Config override
All of the alert methods can accept a config object as second parameter if you need to override the defaults. Example:
this$noty // fal is a FontAwesome Pro icon
For more information about available configuration properties, please read Noty's documentation.