Socket
Socket
Sign inDemoInstall

maya-vue-cookie-notice

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    maya-vue-cookie-notice

Vue component for accepting and rejecting cookies


Version published
Weekly downloads
3
Maintainers
1
Created
Weekly downloads
 

Readme

Source

A simple vue component to accept/reject cookies.

Installation

yarn add maya-vue-cookie-notice

or

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

FAQs

Last updated on 12 Oct 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc