Gismo1337 / vue-cookie-consent-banner

Vue Cookie Consent Banner Component without dependecies. Feel free to contribute.
https://github.com/Gismo1337/vue-cookie-consent-banner
MIT License
5 stars 18 forks source link

Save user preferences to cookie #16

Closed alexjharrison closed 2 years ago

alexjharrison commented 2 years ago

On hitting accept, the user preferences are saved in a cookie expiring in the year 9999.

On page mount, the component reads and parses the page cookies looking for the cookie key. If found, it automatically accepts the user preferences and closes the modal.

A showModal ref is added to prevent the banner from briefly flashing until the cookie contents have been read and parsed.

Closes #12