Using the Vue Cookie Law plugin to let users know about website cookies
Vue Cookie Law
The Cookie Law is a piece of privacy legislation that requires websites to get consent from visitors to store or retrieve any information on a computer, smartphone or tablet. It started as an EU Directive that was adopted by all EU countries in May 2011. The Directive gave individuals rights to refuse the use of cookies that reduce their online privacy. Each country then updated its own laws to comply.
The Hackable EU Cookie Law Plugin for Vue.js, can help you comply with the law by providing a notification bar, which can be custom, to display your own message and make use of your own theme.
Below you will find a usage example of this plugin and the features it is offering.
Example
Install via yarn
:
yarn add vue-cookie-law
Import in your file and then use it in your template
<script>
import CookieLaw from 'vue-cookie-law'
export default {
components: { CookieLaw }
}
</script>
<template>
<footer>
<cookie-law theme="blood-orange"
buttonText="I understand"
position="top"
transitionName="fade"
>
</cookie-law>
</footer>
</template>
The plugin is offering props regarding the position, message & button text, transitions and themes (currenlty 4 available, you can create your own).
The Vue Cookie plugin is available here, along with everything you need to get it started.