Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vs-alert

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vs-alert

A simple vue alert. Perfect for all your alert scenarios.

  • 1.2.71
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

Vue Simple Alert

🗃 A simple vue alert. Perfect for all your alert scenarios.

A light weight vue plugin built groundup.

npm npm

forthebadge forthebadge forthebadge forthebadge forthebadge forthebadge


📺 Live Demo

Code Sandbox Demo: Link
Code Sandbox: Link


🛠 Install

npm i vs-alert
yarn add vs-alert

🚀 Usage

<template>
  <vs-alert type="success">
    Success
  </vs-alert>
</template>

<script>
  import VsAlert from 'vs-alert';

  export default {
    components: {
      VsAlert,
    },
  };
</script>

🌎 CDN

<script src="https://unpkg.com/vs-alert@1.2.71/dist/vs-alert.min.js"></script>
<template>
  <vs-alert type="success">
    Success
  </vs-alert>
</template>

Nuxt.js

Nuxt Code Snippet

After installation,

  • Create a file /plugins/vs-alert.js

    import Vue from 'vue';
    import VsAlert from 'vs-alert';
    
    Vue.component('vs-alert', VsAlert);
    
  • Update nuxt.config.js

    module.exports = {
      ...
      plugins: [
        { src: '~plugins/vs-alert', mode: 'client' }
        ...
      ]
    }
    
  • In the page/ component

    <template>
      <vs-alert type="success">
        Success
      </vs-alert>
    </template>
    

Note

  • For older Nuxt versions, use <no-ssr>...</no-ssr> tag.
  • You can also do import VsAlert from 'vs-alert' & add in component:{VsAlert} and use it within component, without globally installing in plugin folder.

⚙ Props

NameTypeDefaultDescription
typeString-Type of alert to be shown. (success, warning, error, info)
titleString-The alert title (text only). For HTML, use the header slot.
showCloseBoolean-Show alert close icon

🔥 Events

NameDescription
closeEmitted when the alert close icons is clicked. Listen for it using @close.

📎 Slots

You can define own item markup via slots:

NameDescription
(default)Holds the alert content and can contain HTML.

Keywords

FAQs

Package last updated on 10 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc