Simple Alert for vue.js ,Popup Box Component on SweetAlert2

Simple Alert for vue.js ,Popup Box Component on SweetAlert2

Simple Alert for vue.js ,Popup Box Component on SweetAlert2.Simple alert(), confirm(), prompt() for Vue.js, using sweetalert2.

Description:

Simple alert(), confirm(), prompt() for Vue.js, using sweetalert2.

Features

  • Provides simple alert(), confirm(), prompt() like DOM Window methods.
  • Based on sweetalert2.
  • Installed as a Vue.js plugin.
  • Promise based API.
  • Support typescript.

Install:

npm i vue-simple-alert

How to use it:

install plugin

// main.js
import Vue from "vue";
import VueSimpleAlert from "vue-simple-alert";

Vue.use(VueSimpleAlert);
  1. Create an alert dialog and return a promise which will be resolved when the OK button clicked. Possible parameters:
  • message: alert message
  • title: alert title
  • type: ‘success’,  ‘error’, ‘warning’, ‘info’,  ‘question’
// alert(message, title, type)
this.$alert("Alert Message.");

This is image title

  1. Create a confirm dialog and return a promise which will be resolved when the OK button clicked. Possible parameters:
  • message: confirm message
  • title: confirm title
  • type: ‘success’,  ‘error’, ‘warning’, ‘info’,  ‘question’
  • reverseButton: set to true if you want to invert default buttons positions
// confirm(message, title, type, reverseButton)
this.$confirm("Are you sure?").then(() => {
  //do something...
});

This is image title

  1. Create a prompt dialog and return a promise which will be resolved when the OK button clicked. Possible parameters:
  • message: confirm message
  • defaultText: placeholder text
  • title: confirm title
  • type: ‘success’,  ‘error’, ‘warning’, ‘info’,  ‘question’
  • reverseButton: set to true if you want to invert default buttons positions
// prompt(message, defaultText, title, type, reverseButton)
this.$prompt("Input your name").then((text) => {
  // do somthing with text
});
  1. You can also create a custom dialog box using the $fire method just like the SweetAlert2 fire function.
this.$fire({
  type: 'error',
  title: 'Oops...',
  text: 'Something went wrong!',
  footer: '<a href>Why do I have this issue?</a>'
}).then(r => {
 console.log(r.value);
});

Previews:

This is image title

Download Details:

Author: constkhi

Live Demo:https://constkhi.github.io/vue-simple-alert/

Download Link: https://github.com/constkhi/vue-simple-alert/archive/master.zip

Official Website: https://github.com/constkhi/vue-simple-alert

vuejs javascript vue-js

What's new in Bootstrap 5 and when Bootstrap 5 release date?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Random Password Generator Online

HTML Color Picker online | HEX Color Picker | RGB Color Picker

Vue ShortKey plugin for Vue.js

Vue-ShortKey - The ultimate shortcut plugin to improve the UX .Vue-ShortKey - plugin for VueJS 2.x accepts shortcuts globaly and in a single listener.

A Vue.js wrapper component for Grid.js

A Vue wrapper component for Grid.js. Grid.js is a Free and open-source HTML table plugin written in TypeScript. It works with most JavaScript frameworks.

Vue.js image clipping Components using Vue-Rx

vuejs-clipper .Vue.js image clipping components using Vue-Rx. Add image clipping components to your Vue application in nothing flat. Touch devices supported and fully responsive.

Syntax highlighting with highlight.js for Vue.js 2.x

vue-highlightjs .Vue.js syntax highlighting made easy, using highlight.js.

Vue.js components rendering 3D WebGL graphics reactively with three.js

Vue.js components rendering 3D WebGL graphics reactively with three.js .Vue.js components rendering 3D WebGL graphics reactively with three.js.