# vue-active-element

> vuejs directive to know if element is active (has clicked focus)

Latest version **2.4.0** (published 2019-08-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-active-element
pnpm add vue-active-element
yarn add vue-active-element
bun add vue-active-element
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.4.0 |
| Published | 2019-08-26 |
| First published | 2018-06-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Julien Barbay |
| Maintainers | y_nk |
| Keywords | vuejs, directive, focus, active-element |

## Links

- npm: https://www.npmjs.com/package/vue-active-element
- Repository: https://github.com/y-nk/vue-active-element
- Homepage: https://github.com/y-nk/vue-active-element#readme
- Issues: https://github.com/y-nk/vue-active-element/issues
- npm.io page: https://npm.io/package/vue-active-element

## Recent versions

- 2.4.0 (latest) — 2019-08-26
- 2.3.0 — 2019-05-08
- 2.2.0 — 2019-04-12
- 2.1.0 — 2019-02-05
- 2.0.0 — 2019-02-05
- 1.3.0 — 2018-11-14
- 1.2.0 — 2018-11-14
- 1.1.0 — 2018-10-24
- 1.0.5 — 2018-07-11
- 1.0.3 — 2018-07-11
- 1.0.2 — 2018-07-11
- 1.0.1 — 2018-06-22
- 1.0.0 — 2018-06-22

## README

# vue-active-element
## what
a very candide fragment component for Vue.js

## why
If you want to know if your user clicked on your element and get a boolean for it, it's sure easy ; if you want to know is that element lost user click-focus, it's a bit different. You may succeed in few lines, but why not a handy directive instead ?

### How
The directive uses `argument` to get the reactive property to update from the vnode context, so it's actually possible to put this directive and update "parent" nodes.

### Use
-  download the package `npm i -s vue-active-element`

From here, you can load a plugin version, or use the directive independently.

- Plugin:
    ```
    import ActiveElement from 'vue-active-element'
    Vue.use(ActiveElement.Plugin)

    …

    export const MyComponent {
      template: '
      <div class="component">
        <div class="nested-child" v-active-element="property"></div>
      </v-fragment>
      ',
      data() { return { property: undefined }}
    }
    ```

- Component:
    ```
    import AE from 'vue-active-element'

    export const MyComponent {
      directives: { isclick: AE.directive },
      template: '
      <div class="component">
        <div class="nested-child" v-isclick="property"></div>
      </v-fragment>
      ',
      data() { return { property: undefined }}
    }
    ```

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