Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show notification manually #45

Merged
merged 3 commits into from
Feb 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ For a more complex layout use the scoped slot
|---|---|
| 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 |

## Props
| prop | default | type | description
Expand Down
8 changes: 6 additions & 2 deletions src/components/CookieLaw.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<transition appear :name="transitionName">
<div class="Cookie" :class="[containerPosition, cookieTheme]" v-if="isOpen">
<slot :accept="accept" :close="close">
<slot :accept="accept" :close="close" :open="open">
<div class="Cookie__content">
<slot name="message">{{ message }}</slot>
</div>
Expand Down Expand Up @@ -132,9 +132,13 @@
this.isOpen = false
this.$emit('accept')
},

close () {
this.isOpen = false
},
open () {
if (!this.getVisited() === true) {
this.isOpen = true
}
}
}
}
Expand Down