vue3-confirm-dialog

Simple Confirm Dialog verification plugin with Vue 3.
9,660
Install
npm install vue3-confirm-dialog
Latest Version:0.1.1
Vue:3
License:MIT
Last Updated:Jan 13, 2023
Links: npm
Maintainer: rowathy

vue3-confirm-dialog

Simple Confirm Dialog verification plugin with Vue 3.

Demo: https://github.com/rowathy/vue3-confirm-dialog

confirm-dialog

Install

npm install --save vue3-confirm-dialog

Quick Start Usage

In main.js or plugin (for Nuxt.js):

import { createApp } from 'vue';
import Vue3ConfirmDialog from 'vue3-confirm-dialog';
import 'vue3-confirm-dialog/style;

const app = createApp();

app.use(Vue3ConfirmDialog);
app.component('vue3-confirm-dialog', Vue3ConfirmDialog.default)

In App.vue (or in the template file for Nuxt.js (layout/default.vue)):

<template>
  <div id="app">
    <vue3-confirm-dialog></vue3-confirm-dialog>
    <!-- your code -->
  </div>
</template>

<script>
  export default {
    name: 'app'
  }
</script>

In any of functions :

methods: {
    handleClick(){
      this.$confirm(
        {
          message: 'Are you sure?',
          button: {
            no: 'No',
            yes: 'Yes'
          },
          /**
          * Callback Function
          * @param {Boolean} confirm
          */
          callback: confirm => {
            if (confirm) {
              // ... do something
            }
          }
        }
      )
    }
  }

Use only for information

If you want to use only for information and you want of see one button in dialog, you can use only one of 'no' or 'yes' button object.

vue-confirm

methods: {
    handleClick(){
      this.$confirm(
        {
          title: 'Information',
          message: 'This content has been removed',
          button: {
          	yes: 'OK',
          }
        },
        /**
        * Callback Function
        * @param {Boolean} confirm
        */
        callback: confirm => {
          if (confirm) {
            // ... do something
          }
        }
      )
    }
  }

Related Packages

vue-confirm-dialog

simple action confirm

673,100 190
vc-popup-dialog

vc-popup-dialog

954
@zapadale/vue3-confirm-dialog

Vue.js 3 version of Simple Confirm Dialog verification plugin

2,181 0
vue-final-modal

The most powerful yet most light-weight modal library for Vue 3.

3,105,553 1,013

Version History

Version Released Vue License
0.1.1 ^3.2.41 MIT
0.1.0 ^3.2.41 MIT
0.0.9 ^3.2.41 MIT
0.0.8 ^3.2.41 MIT
0.0.7 ^3.2.41 MIT