2.1.5 • Published 5 years ago

vue-bootstrap-cookie-law v2.1.5

Weekly downloads
9
License
MIT
Repository
github
Last release
5 years ago

🍪 👮 Vue Cookie Law

Build Status npm vue2 license

EU Cookie Law Plugin for Vue.js - Originally written by Jakub Juszczak jakub@posteo.de

🔧 Install

yarn add vue-bootstrap-cookie-law

👈 Usage

<template>
  <footer>
    <cookie-law theme="white-transparent"></cookie-law>
  </footer>
</template>

<script>
  import CookieLaw from 'vue-bootstrap-cookie-law'
  export default {
    components: { CookieLaw }
  }
</script>

Slots

You can also pass in the message into a named slot. This way you can for example add <router-link> and other dynamic content.

<cookie-law>
  <div slot="message">
    <p>Here is my message for more info <router-link to="legal-notes">Click here</router-link></p>
  </div>
</cookie-law>

Props

propdefaulttypedescription
buttonText'Got It!'String🔘 Well, its the button text
buttonLinkString|ObjectLink to more infos. Simple href or a vue-router Location object
buttonLinkText'More info'StringLabel of link button
buttonLinkNewTabfalseBooleanIf true, it opens the link in a new tab/window (href)
buttonClass'Cookie__button'StringCustom class name for buttons
message'This website uses cookies to ensure you get the best experience on our website.'StringYour message in the content area
theme'base'StringSelected theme. You can also create a custom one
position'bottom'StringPossible positions are bottom or top
transitionName'slideFromBottom'StringEnter and leave transitions. Currenty supported slideFromBottom, slideFromTop, fade

Events

The default button will emit an accept event you can listen on if the user clicks the button.

<cookie-law v-on:accept="ThankYouMethod()"/>

💅 Themes

Cookie Law Themes

Custom Themes

You can easy create your own themes. The classes that need to be styled are:

  • .cookie for the container
  • .cookie-content for the content with message
  • .cookie-button for the button

And then pass your theme name to the component.

:copyright: License

MIT

2.1.5

5 years ago

2.1.3

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.11

6 years ago

2.0.10

6 years ago

2.0.9

6 years ago

2.0.7

6 years ago

2.0.6

6 years ago

2.0.0

6 years ago