# maya-vue-cookie-notice

> Vue component for accepting and rejecting cookies

Latest version **1.0.1** (published 2021-10-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install maya-vue-cookie-notice
pnpm add maya-vue-cookie-notice
yarn add maya-vue-cookie-notice
bun add maya-vue-cookie-notice
```

## 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 | 1.0.1 |
| Published | 2021-10-12 |
| First published | 2021-10-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jake Gully |
| Maintainers | mayastudio |

## Links

- npm: https://www.npmjs.com/package/maya-vue-cookie-notice
- Repository: https://github.com/hellomayaagency/vue-cookie-notice
- Homepage: https://github.com/hellomayaagency/vue-cookie-notice#readme
- Issues: https://github.com/hellomayaagency/vue-cookie-notice/issues
- npm.io page: https://npm.io/package/maya-vue-cookie-notice

## Recent versions

- 1.0.1 (latest) — 2021-10-12

## README

# Vue Cookie Notice

A simple vue component to accept/reject cookies.

# Installation

```shell
yarn add maya-vue-cookie-notice
```

or

```shell
npm install --save maya-vue-cookie-notice
```

# Usage

First, you'll want to extend `CookieNotice.vue'.

```
// MyCookieNotice.vue
<script>
import CookieNotice from 'maya-vue-cookie-notice';

export default {
  extends: CookieNotice,

  methods: {
    handleAccepted() {
      if (document.querySelector('[src^="https://example.com/script.js"]')) {
        var script = document.createElement('script');
        script.type = 'text/javascript';
        script.src = 'https://example.com/script.js';
        document.body.append(script);
      }
    },

    handleRejected () {
      document.getElementById('myThingToRemove').remove();
    },
  }
}
</script>
```

# Props

- wrapper-class
- btn-wrapper-class
- accept-btn-class
- accept-btn-text
- reject-btn-class
- reject-btn-text
- cookie-name
- reset-selector
- body-accepted-class
- body-rejected-class

# Events

- accept
- reject

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