v-slim-dialog
Slim Dialog for Vuejs
Installation
yarn add v-slim-dialog# Or using npm npm install v-slim-dialog --save
Usage
Vue
Options params
Name | Type | Required | Default value | Info |
---|---|---|---|---|
title | String | No | Title of modal | |
okLabel | String | No | OK | Label of button OK |
cancelLabel | String | No | Cancel | Label of button cancel |
size | String('sm'or'lg') | No | Size of modal | |
prompt | Object | No | Hash for prompt {value: '', invalidMessage: 'invalid!', component: VueComponent} |
In your component
alert
//...methods: /** * @param String message * @param Object options default { title, okLabel = 'OK', size } */ { const options = title: 'Info' size: 'sm' this$dialogs }//...
confirm
//...methods: /** * @param String message * @param Object options default { title, cancelLabel = 'Cancel', okLabel = 'OK', size } */ { const options = title: 'Confirm?' cancelLabel: 'No' this$dialogs } //...
prompt
//...methods: /** * @param String message * @param Object options default { title, okLabel = 'OK', size, prompt } */ { const options = title: 'Continue?' okLabel: 'Continue' this$dialogsprompt'Your message!' options // with custom input prompt const options = title: 'Continue?' prompt: component: 'cpf-cnpj' this$dialogsprompt'Your message!' options // or const options = title: 'Continue?' prompt: component: YourComponent this$dialogsprompt'Your message!' options } //...
Sample custom prompt Component
This is the default component if you do not report
Development
# install dependencies yarn install # build with minification yarn release # publish bin/publish