# @lassehaslev/vue-modal

> Simple Modal logic with vue

Latest version **3.1.1** (published 2017-02-17) · 0 weekly downloads

## Install

```sh
npm install @lassehaslev/vue-modal
pnpm add @lassehaslev/vue-modal
yarn add @lassehaslev/vue-modal
bun add @lassehaslev/vue-modal
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.1.1 |
| Published | 2017-02-17 |
| First published | 2016-07-19 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Lasse S. Haslev |
| Maintainers | lassehaslev |

## Links

- npm: https://www.npmjs.com/package/@lassehaslev/vue-modal
- Repository: https://github.com/lassehaslev/vue-modal
- Homepage: https://github.com/lassehaslev/vue-modal#readme
- Issues: https://github.com/lassehaslev/vue-modal/issues
- npm.io page: https://npm.io/package/@lassehaslev/vue-modal

## Dependencies (1)

- [vue](https://npm.io/package/vue.md) ^2.1.0

## Recent versions

- 3.1.1 (latest) — 2017-02-17
- 3.1.0 — 2017-01-10
- 3.0.0 — 2016-12-19
- 2.0.1 — 2016-11-01
- 2.0.0 — 2016-10-28
- 0.1.0 — 2016-07-19

## README

# @lassehaslev/vue-modal

> Simple Modal logic with Vue2

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

## Usage
Use this simple modal with [Bulma](https://trello.com/b/BDC3zQvN).
``` js
import { Modal } from '@lassehaslev/vue-modal';
export default {
    template: `
        <a @click="open" class="button is-primary is-large" href="#">Open a simple modal</a>
        <modal ref="modal">
            <!-- Modal content Start -->
            <div class="box has-text-centered">
                <h1 class="title">
                    First modal
                </h1>
            </div>
            <!-- Modal content END -->
        </modal>
    `,
    methods: {
        open() {
            this.$refs.modal.open();
        }
    },
    components: {
        Modal,
    }
}
```

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

export default {
    template: `
    <div v-show="isShowingModal" class="modal is-active">
        <div class="modal-background" @click="close"></div>
        <div class="modal-content">
            <slot></slot>
        </div>
        <button class="modal-close" @click="close"></button>
    </div>
    `,

    mixins: [ BaseModal ],
}
```


## 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).

---
_Source: https://npm.io/package/@lassehaslev/vue-modal · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
