An open API service indexing awesome lists of open source software.

https://github.com/lassehaslev/vue-confirm

Simple confirm dialog using vue 2
https://github.com/lassehaslev/vue-confirm

Last synced: 12 months ago
JSON representation

Simple confirm dialog using vue 2

Awesome Lists containing this project

README

          

# @lassehaslev/vue-confirm

> Simple confirm dialog using vue

## Installation
Run ```npm install @lassehaslev/vue-confirm --save``` in your project folder

## Usage
Use this simple confirm with [Bulma](https://trello.com/b/BDC3zQvN).
This package is based on [@lassehaslev/vue-modal](https://github.com/LasseHaslev/vue-modal)
``` js
import { Confirm } from '@lassehaslev/vue-confirm';
export default {
template: `
Open a simple confirm

`,
methods: {
open() {
this.$refs.confirm.open();
}
},
components: {
Confirm,
}
}
```

## Extend / Build your own!
Just include the BaseConfirm class as a mixin, and you are good to call ```confirm``` and ```cancel``` and checking ```isShowingModal``` boolean.
```js
import BaseConfirm from '@lassehaslev/vue-confirm';

export default {
template: `


`,

mixins: [ BaseConfirm ],
}
```

## Development

``` bash
# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build
```

For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).