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
- Host: GitHub
- URL: https://github.com/lassehaslev/vue-confirm
- Owner: LasseHaslev
- Created: 2016-12-19T13:26:16.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-17T20:46:24.000Z (over 9 years ago)
- Last Synced: 2025-02-23T18:16:53.591Z (over 1 year ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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).