Closed garbit closed 5 years ago
Hey there - sorry you're having trouble.
To remove the cookie so you can show the panel again, you can use the method this.$refs.myPanel1.removeCookie()
. This will physically remove the cookie.
Then, listen for the removed-cookie
event that will be emitted, which in your example you have connected to cookieRemovedCookie
, and run this.$refs.myPanel1.init()
to bring the panel back up so the user can choose again.
The example page shows a good example of the whole process - https://github.com/promosis/vue-cookie-accept-decline/blob/master/example/App.vue
Let me know how it goes - we'll adjust it from there if we need to.
Did this end up working for you?
Edit - Will close for now - let us know if you need any further help with this.
Hi there,
I'm trying to re-show the cookie prompt in order to allow the user to either accept / reject the cookie prompt again however the .init() function doesn't seem to be showing the prompt window again.
Workflow is as follows: Show cookie prefs anchor is clicked >SHOWCOOKIEPROMPT event emitted > showCookieConsent method called > this.$refs.myPanel1.init();
I can see the events being emitted in the vue dev tools however it looks like the event is being emitted multiple times. It also looks like the event :
Link
Thanks in advance,
Andy
Code: