Socket
Socket
Sign inDemoInstall

vuejs-cookies-consent

Package Overview
Dependencies
10
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

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


Version published
Weekly downloads
1
Maintainers
1
Install size
89.2 kB
Created
Weekly downloads
 

Readme

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

Last updated on 29 Sep 2022

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