seifip / vuetify-confirm

Extends vuetify.js confirm dialog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vuetify.js confirm dialog

This module extends vuetify confirm dialog.

Setup

Install the package from npm

npm install vuetify-confirm
import VuetifyConfirm from 'vuetify-confirm'
Vue.use(VuetifyConfirm)

Install with options or any of them:

import VuetifyConfirm from 'vuetify-confirm'
Vue.use(VuetifyConfirm, {
  buttonTrueText: 'OK',
  buttonFalseText: 'On, ho',
  color: 'warning',
  icon: 'warning',
  title: 'Warning',
  width: 300,
  property: '$confirm'
})

property: '$confirm' will create property with this name in Vue prototype

Usage

this.$confirm('Do you really want to exit?').then(res => {
})
let res = await this.$confirm('Do you really want to exit?', {title: 'Warning'})
if (res) {
  ...
}

res will be true or false

You can format your message with arbitrary HTML - make sure you don't include any user-provided content here:

this.$confirm('Please do not do this.<br>Do you really want to exit?').then(res => {
})

About

Extends vuetify.js confirm dialog

License:MIT License


Languages

Language:Vue 63.8%Language:JavaScript 36.2%