Giter VIP home page Giter VIP logo

vuejs-noty's Introduction

vuejs-noty

A Vue JS wrapper around Noty. Developped for Vue 2.

Getting Started

Install using npm:

$ npm install vuejs-noty

Import and register Vue plugin:

import Vue from 'vue'
import VueNoty from 'vuejs-noty'

Vue.use(VueNoty)

Import noty styles

Import stylesheet in your vue / js components:

import 'vuejs-noty/dist/vuejs-noty.css'

Or, import styles in your less / scss stylesheet:

@import '~vuejs-noty/dist/vuejs-noty.css';

Usage

In your Vue.js components, simply call one of these methods:

// 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.

Configuration

Config defaults

You can set a default configuration object when registering the plugin. Example:

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:

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.

vuejs-noty's People

Contributors

renoguyon avatar stranger26 avatar idelsink avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.