Semantic UI 2.3 confirmation modal with Vue 2
Based on
https://godofbrowser.github.io/vuejs-dialog/
Installation
NPM
// installation via npmnpm install vuejs-dialog // import into project // Tell Vue to install the plugin.Vue
Basic Usage
// Anywhere in your Vuejs App. this$dialog ;
Usage with ajax - Loader enabled
// Anywhere in your Vuejs App. this$dialog ;
Usage as a directive (new)
If you don't pass a message, the global/default message would be used.
submit
// Callbacks can be provided// Note: If "loader" is set to true, the makeAdmin callback will be passed a "dialog" object// Which is useful for stoping the loader, or closing the dialog.Make Admin
methods: { // Do stuffs } { // Do nothing or some other stuffs }
For v-confirm directive, if an "OK" callback is not provided, the default event would be triggered.
// You can use it on links tooGo to example.com
Options
// Parameters and options let message = "Are you sure?"; let options = html: false // set to true if your message contains HTML tags. eg: "Delete <b>Foo</b> ?" loader: false // set to true if you want the dailog to show a loader after click on "proceed" reverse: false // switch the button positions (left to right, and vise versa) okText: 'Continue' cancelText: 'Close' animation: 'zoom' // Available: "zoom", "bounce", "fade" type: 'basic' // coming soon: 'soft', 'hard' verification: 'continue' // for hard confirm, user will be prompted to type this to enable the proceed button clicksCount: 3 // for soft confirm, user will be asked to click on "proceed" btn 3 times before actually proceeding; this$dialog ;
Global Configuration
// You can also set all your defaults at the point of installation.// This will be your global configuration Vue // Please note that local configurations will be considered before global configurations.// This gives you the flexibility of overriding the global config on individual call.