All Projects → apertureless → Vue Cookie Law

apertureless / Vue Cookie Law

Licence: mit
🍪 👮 Hackable EU Cookie Law Plugin for Vue.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Vue Cookie Law

Vue Highlightjs
Syntax highlighting with highlight.js for Vue.js 2.x
Stars: ✭ 295 (-11.41%)
Mutual labels:  vuejs2
Vue Progress Path
Progress bars and loading indicators for Vue.js
Stars: ✭ 309 (-7.21%)
Mutual labels:  vuejs2
Js Cookie
A simple, lightweight JavaScript API for handling browser cookies
Stars: ✭ 18,861 (+5563.96%)
Mutual labels:  cookie
Vue Cnodejs
基于vue.js重写Cnodejs.org社区的webapp
Stars: ✭ 3,065 (+820.42%)
Mutual labels:  vuejs2
Vue Kindergarten
Modular security for Vue, Vuex, Vue-Router and Nuxt
Stars: ✭ 303 (-9.01%)
Mutual labels:  vuejs2
Vue.resize
Vue directive to detect resize events with deboucing and throttling capacity.
Stars: ✭ 318 (-4.5%)
Mutual labels:  vuejs2
Paascloud Mall Web
模拟商城,完整的购物流程、后端运营平台,使用 spring cloud + vue 全家桶实现快速搭建企业级微服务项目
Stars: ✭ 287 (-13.81%)
Mutual labels:  vuejs2
Vuetified
Laravel Starter App Using Vue ,Vuetify, and InertiaJS.
Stars: ✭ 327 (-1.8%)
Mutual labels:  vuejs2
Mix.core
🚀 Mixcore CMS is an open source CMS that support both headless and decoupled to easily build any kinds of app/web app/customisable APIs built on top of ASP.NET Core / Dotnet Core. It is a completely open source ASP.NET Core (Dotnet Core) CMS solution. https://mixcore.org
Stars: ✭ 304 (-8.71%)
Mutual labels:  vuejs2
Jianzhi V2
基于laravel5.5跟Vue2前后端分离的兼职平台
Stars: ✭ 327 (-1.8%)
Mutual labels:  vuejs2
Vue Qart
the compoent of vue 2.x for qart.js
Stars: ✭ 298 (-10.51%)
Mutual labels:  vuejs2
Vue Project
基于vue-cli构建的财务后台管理系统(vue2+vuex+axios+vue-router+element-ui+echarts+websocket+vue-i18n)
Stars: ✭ 301 (-9.61%)
Mutual labels:  vuejs2
Publii
Publii is a desktop-based CMS for Windows, Mac and Linux that makes creating static websites fast and hassle-free, even for beginners.
Stars: ✭ 3,644 (+994.29%)
Mutual labels:  vuejs2
Vue Cookies
A simple Vue.js plugin for handling browser cookies
Stars: ✭ 293 (-12.01%)
Mutual labels:  cookie
Quasar
Quasar Framework - Build high-performance VueJS user interfaces in record time
Stars: ✭ 20,090 (+5933.03%)
Mutual labels:  vuejs2
Xhttp2
💪A powerful network request library, encapsulated using the RxJava2 + Retrofit2 + OKHttp combination.(一个功能强悍的网络请求库,使用RxJava2 + Retrofit2 + OKHttp组合进行封装)
Stars: ✭ 292 (-12.31%)
Mutual labels:  cookie
Vue Page Transition
A lightweight Vue.js plugin for page / route transitions.
Stars: ✭ 311 (-6.61%)
Mutual labels:  vuejs2
Vue Types
Vue Prop Types definitions
Stars: ✭ 331 (-0.6%)
Mutual labels:  vuejs2
Vue Storefront Api
Vue.js storefront for Magento2 (and not only) - data backend
Stars: ✭ 328 (-1.5%)
Mutual labels:  vuejs2
Cookies Eu Banner
1kb vanilla JS script which manages cookies consent banner display like asked by GDPR
Stars: ✭ 326 (-2.1%)
Mutual labels:  cookie

🍪 👮 Vue Cookie Law

Build Status npm vue2 license

ko-fi

EU Cookie Law Plugin for Vue.js

📺 Demo

🔧 Install

yarn add vue-cookie-law

👈 Usage

<template>
  <footer>
    <cookie-law theme="dark-lime"></cookie-law>
  </footer>
</template>

<script>
  import CookieLaw from 'vue-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">
    Here is my message for more info <router-link to="legal-notes">Click here</router-link>
  </div>
</cookie-law>

Scoped Slot

For a more complex layout use the scoped slot

<cookie-law>
  <div slot-scope="props">
    <button class="skew" @click="props.accept"><span>I accept</span></button>
    <p>
      This site uses 🍪
    </p>
    <button class="skew" @click="props.close"><span>Ignore me</span></button>
  </div>

</cookie-law>
methods description
accept Closes the cookie disclaimer and saves to localStorage
close Only closes the cookie disclaimer. The disclaimer will reappear on the next page load.
open Show disclaimer if user ignored him
revoke Revoke previous user decision
isAccepted To check anytime if cookies has been accepted

Props

prop default type description
buttonText 'Got It!' String 🔘 Well, its the button text
buttonLink String|Object Link to more infos. Simple href or a vue-router Location object
buttonLinkText 'More info' String Label of link button
buttonLinkNewTab false Boolean If true, it opens the link in a new tab/window (href)
buttonClass 'Cookie__button' String Custom class name for buttons
message 'This website uses cookies to ensure you get the best experience on our website.' String Your message in the content area
theme 'base' String Selected theme. You can also create a custom one
position 'bottom' String Possible positions are bottom or top
transitionName 'slideFromBottom' String Enter and leave transitions. Currently supported slideFromBottom, slideFromTop, fade
storageName 'cookie:accepted' String Name for the localStorage / cookie name. Defaults to cookie:accepted
storageType 'localStorage' String Type of storage, where to store 'cookies:accept': true. Can be localStorage (default) or cookies. If LocalStorage is unsupported, then used Cookies.
cookieOptions {} Object (Optional) The cookieOptions parameter is an object. And its property can be a valid cookie option, such as path, domain, expires / max-age, samesite or secure. See tiny-cookie docs for details.
buttonDecline false Boolean Display decline button
buttonDeclineText 'Decline' String 🔘Decline button text
buttonDeclineClass 'Cookie__button--decline' String Custom class name for decline button

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

If you create your own theme, postfix the class.

.Cookie--mytheme {....}
.Cookie--mytheme .Cookie__button {....}
.Cookie--mytheme div.Cookie__button:hover {....}

And then pass your theme name to the component.

📜 Changelog

Details changes for each release are documented in the CHANGELOG.md.

❗️ Issues

Please make sure to read the Issue Reporting Checklist before opening an issue. Issues not conforming to the guidelines may be closed immediately.

💪 Contribution

Please make sure to read the Contributing Guide and Code of Conduct before making a pull request.

©️ License

MIT

Buy Me A Coffee

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].