Installations
npm install vue-cookie-law
Releases
💎 Release new version 1.13.2
Published on 31 Mar 2020
💎 Release new version 1.13.1
Published on 31 Mar 2020
💎 Release new version 1.13.0
Published on 30 Mar 2020
💎 Release new version 1.12.0
Published on 14 Feb 2020
💎 Release new version 1.11.0
Published on 01 Nov 2019
💎 Release new version 1.10.0
Published on 18 Mar 2019
Developer
apertureless
Developer Guide
Module System
CommonJS
Min. Node Version
>= 4.0.0
Typescript Support
No
Node Version
13.12.0
NPM Version
6.14.4
Statistics
379 Stars
114 Commits
43 Forks
8 Watching
2 Branches
18 Contributors
Updated on 23 Nov 2024
Languages
JavaScript (68.77%)
Vue (30.68%)
HTML (0.55%)
Total Downloads
Cumulative downloads
Total Downloads
2,707,996
Last day
28.4%
2,248
Compared to previous day
Last week
1.3%
11,312
Compared to previous week
Last month
2.7%
47,503
Compared to previous month
Last year
-7.6%
378,318
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Dev Dependencies
56
🍪 👮 Vue Cookie Law
EU Cookie Law Plugin for Vue.js
📺 Demo
🔧 Install
yarn add vue-cookie-law
👈 Usage
1 2<template> 3 <footer> 4 <cookie-law theme="dark-lime"></cookie-law> 5 </footer> 6</template> 7 8<script> 9 import CookieLaw from 'vue-cookie-law' 10 export default { 11 components: { CookieLaw } 12 } 13</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.
1<cookie-law> 2 <div slot="message"> 3 Here is my message for more info <router-link to="legal-notes">Click here</router-link> 4 </div> 5</cookie-law>
Scoped Slot
For a more complex layout use the scoped slot
1<cookie-law> 2 <div slot-scope="props"> 3 <button class="skew" @click="props.accept"><span>I accept</span></button> 4 <p> 5 This site uses 🍪 6 </p> 7 <button class="skew" @click="props.close"><span>Ignore me</span></button> 8 </div> 9 10</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.
1<cookie-law v-on:accept="ThankYouMethod()"/>
💅 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.
1.Cookie--mytheme {....} 2.Cookie--mytheme .Cookie__button {....} 3.Cookie--mytheme div.Cookie__button:hover {....}
And then pass your theme name to the component.
:scroll: Changelog
Details changes for each release are documented in the CHANGELOG.md.
:exclamation: Issues
Please make sure to read the Issue Reporting Checklist before opening an issue. Issues not conforming to the guidelines may be closed immediately.
:muscle: Contribution
Please make sure to read the Contributing Guide and Code of Conduct before making a pull request.
:copyright: License
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 10/30 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'develop'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 11 are checked with a SAST tool
Reason
81 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-6chw-6frg-f759
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-whgm-jr23-g3j9
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25
- Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw
- Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5
- Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-phwq-j96m-2c2q
- Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6
- Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2
- Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w
- Warn: Project is vulnerable to: GHSA-434g-2637-qmqr
- Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m
- Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw
- Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p
- Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747
- Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc
- Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx
- Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q
- Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c
- Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-pfq8-rq6v-vf5m
- Warn: Project is vulnerable to: GHSA-6x33-pw7p-hmpq
- Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27
- Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37
- Warn: Project is vulnerable to: GHSA-7r28-3m3f-r2pr
- Warn: Project is vulnerable to: GHSA-r8j5-h5cx-65gg
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488
- Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p
- Warn: Project is vulnerable to: GHSA-r8f7-9pfq-mjmv
- Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-566m-qj78-rww5
- Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-7mwh-4pqv-wmr8
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-h9rv-jmmf-4pgx
- Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc
- Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-5j4c-8p2g-v4jx
- Warn: Project is vulnerable to: GHSA-g3ch-rx76-35fx
- Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
2.1
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More