Implementation of vuedl dialog helper with Vuetify.js framework
vuetify-dialog - vuetify dialog helper
Implementation of vuedl dialog helper with Vuetify.js framework
This module will help you to work with modal dialogs in your project
Setup
Install the package from npm
npm install vuetify-dialog
import VuetifyDialog from 'vuetify-dialog'
Vue.use(VuetifyDialog, {
context,
property
})
context
- the context of your application, such as store, axios, router etc.property
- the property, which will integrate to Vue. Default is$dialog
Simple confirm dialog
const res = await this.$dialog.confirm({
text: 'Do you really want to exit?'
title: 'Warning'
})
Warning dialog
const res = await this.$dialog.warning({
text: 'Do you really want to exit?',
title: 'Warning'
})
Error dialog
this.$dialog.error({
text: 'Cannot delete this item',
title: 'Error'
})
Prompt dialog
let res = await this.$dialog.prompt({
text: 'Your name',
title: 'Please input your name'
})
Messages
this.$dialog.message.warning('Warning message')
this.$dialog.message.error('Error message')
this.$dialog.message.info('Info message')
this.$dialog.message.success('Success message')
Actions
To all this simple dialogs you can config your actions, just put to options
{
...
actions: {
'false': 'No',
'true': 'Yes'
}
}
// result will be true, false, or undefigned
{
...
actions: ['No', 'Yes']
}
// result will be 'No', 'Yes', or undefigned
You can also send full button options
{
actions: [{
text: 'Yes', color: 'blue', key: true
}]
}