npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vuetify3-confirm-dialog

v2.1.0

Published

The Confirm dialog for VueJS 3 extend Vuetify3

Downloads

3

Readme

vuetify3-confirm-dialog

Simple Confirm Dialog verification plugin with VueJS 3 and Vuetify 3.

Demo: https://demo.tandd.dev/vuetify3-confirm-dialog/

Install

$ npm install --save vuetify3-confirm-dialog

Or

$ yarn add vuetify3-confirm-dialog

Quick Start Usage

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

import {createApp} from 'vue'
import App from './App.vue'
// Vuetify
import 'vuetify/styles'
import {createVuetify} from 'vuetify'
import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives'

const vuetify = createVuetify({
    components,
    directives,
})

import Vuetify3ConfirmDialog from 'vuetify3-confirm-dialog'

createApp(App).use(vuetify).use(Vuetify3ConfirmDialog).mount('#app')

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


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

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

In any of functions :

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

If you want to use in *.js file (e.g Vuex Store) before import Vue and after use Vue.$confirmDialog.

import Vue from 'vue'

export default {
    namespaced: true,
    state     : {},
    actions   : {
        logout({commit}) {
            Vue.$confirmDialog({
                title   : 'Are you sure?',
                message : 'Are you sure you want to logout?',
                button  : {
                    yes: 'Yes',
                    no : 'Cancel'
                },
                callback: confirm => {
                    // ...do something
                }
            })
        }
    }
}

Props

| Name | Type | Default | Description | |------------------|---------------------------------------------------------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------| | persistent | boolean | false | Clicking outside of the element or pressing esc key will not deactivate it. | | transition | String | fade-transition | Sets the component transition. Can be one of the built in or custom transition. | | width | String I Number | auto | Set the width for the component. | | min-width | String I Number | auto | Set the min-width for the component. | | max-width | String I Number | auto | Set the max-width for the component. | | z-index | String I Number | 2400 | The z-index used for the component | | title-class | String | 'bg-blue' | The card title class. | | content-class | String | | The card body class. | | actions-class | String | | The card actions class. | | variant-button | 'flat' I 'text' I 'elevated' I 'tonal' I 'outlined' I 'plain' | 'outlined' | Applies a distinct style to the component | | no-button-class | String | | The class for "no" button. | | yes-button-class | String | | The class for "yes" button. | | no-button-color | String | | The color for "no" button. | | yes-button-color | String | 'blue' | The color for "yes" button. |

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.

methods: {
    handleClick()
    {
        this.$confirmDialog(
            {
                title  : "Confirm",
                message: "Are you sure?",
                button : {
                    yes: 'Yes'
                },
                /**
                 * Callback Function
                 * @param {Boolean} confirm
                 */
                callback: confirm => {
                    if (confirm) {
                        console.log(confirm)
                        // Do something
                    }
                }
            }
        )
    }
}