Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vuejs-cookies-consent

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vuejs-cookies-consent

Nice and clean component to display message about cookies in Vue

  • 0.0.4
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Size Downloads Version

Nice and clean component to display message about cookies in Vue

📦 Installation

NPM

npm install --save vuejs-cookies-consent

Yarn

yarn add vuejs-cookies-consent

🚀 Usage in Vue Components

<template>
    <cookies-consent :preferences="preferences" />
</template>
<script>
  export default {
    data() {
        preferences: [
            {
                title: 'Analytics',
                description:
                    'Bla bla serviços que podemos oferecer erviços que podemos oferecer erviços que podemos oferecer erviços que podemos oferecer serviços que podemos oferecer.',
                items: [
                    {
                        label: 'GoogleAnalytics',
                        value: 'ga',
                        isEnable: true,
                    },
                    { label: 'Sentry', value: 'sentry', isEnable: true },
                    { label: 'Mapbox', value: 'mapbox', isEnable: true },
                    {
                        label: 'New Relic',
                        value: 'newRelic',
                        isEnable: true,
                    },
                    { label: 'Dog Food', value: 'dogfood', isEnable: true },
                ],
            },
        ],
    }
  }
</script>

🚀 Usage throughout the Vue project

Add this content to main.js

import Vue from "vue";
import CookiesConsent from 'vuejs-cookies-consent'
Vue.use(CookiesConsent)

And add component to your code:

<template>
    <cookies-consent :preferences="preferences" />
</template>

🔧 Props

PropTypeDescriptionExample
preferencesArrayMultiple cookies to choosepreferences="preferences"
headerTitleStringHeading titleheader-title="Cookies Consent"
headerDescriptionStringHeading descriptionheader-description="Bla bla bla"
preferencesLabelStringLabel text for preferences buttonpreferences-label="Preferences"
accept-all-labelStringLabel text for accept all buttonaccept-all-label="Accept all"

🔧 Events

EventDescriptionExample
on-accept-all-cookiesFired after accept all button is clicked@onAcceptAllCookies="someMethod"
on-save-cookie-preferencesFired after save button is clicked@onSaveCookiePreferences="someMethod"

Keywords

FAQs

Package last updated on 29 Sep 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc