
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
v-slim-dialog
Advanced tools
yarn add v-slim-dialog
# Or using npm
npm install v-slim-dialog --save
import Vue from 'vue'
import 'v-slim-dialog/dist/v-slim-dialog.css'
import SlimDialog from 'v-slim-dialog'
Vue.use(SlimDialog)
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} |
//...
methods: {
/**
* @param String message
* @param Object options default { title, okLabel = 'OK', size }
*/
showAlert() {
const options = {title: 'Info', size: 'sm'}
this.$dialogs.alert('Your message', options)
.then(res => {
console.log(res) // {ok: true|false|undefined}
})
}
}
//...
//...
methods: {
/**
* @param String message
* @param Object options default { title, cancelLabel = 'Cancel', okLabel = 'OK', size }
*/
showConfirm() {
const options = {title: 'Confirm?', cancelLabel: 'No'}
this.$dialogs.confirm('Your message!', options)
.then(res => {
console.log(res) // {ok: true|false|undefined}
})
}
}
//...
//...
methods: {
/**
* @param String message
* @param Object options default { title, okLabel = 'OK', size, prompt }
*/
showPrompt() {
const options = {title: 'Continue?', okLabel: 'Continue'}
this.$dialogs.prompt('Your message!', options)
.then(res => {
console.log(res) // {value: 'user input', ok: true|false|undefined}
})
// with custom input prompt
const options = {title: 'Continue?', prompt: {component: 'cpf-cnpj'}}
this.$dialogs.prompt('Your message!', options)
.then(res => {
console.log(res) // {value: 'user input', ok: true|false|undefined}
})
// or
import YourComponent from './YourComponent'
const options = {title: 'Continue?', prompt: {component: YourComponent}}
this.$dialogs.prompt('Your message!', options)
.then(res => {
console.log(res) // {value: 'user input', ok: true|false|undefined}
})
}
}
//...
This is the default component if you do not report
<template>
<input v-model='model'>
</template>
<script>
export default {
props: {
value: [Number, String]
},
computed: {
model: {
get() {
return this.value
},
set(v) {
this.$emit('input', v)
}
}
},
methods: {
isValid() {
return Boolean(String(this.model).trim())
}
},
mounted() {
this.$el.focus()
}
}
</script>
# install dependencies
yarn install
# build with minification
yarn release
# publish
bin/publish
FAQs
Vue Dialog
The npm package v-slim-dialog receives a total of 146 weekly downloads. As such, v-slim-dialog popularity was classified as not popular.
We found that v-slim-dialog demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.