ambitiondev / cookiebot

Composable to use Cookiebot functionality in your Vue or Nuxt application,
https://vue-nuxt-cookiebot.netlify.app/
MIT License
5 stars 0 forks source link

How do you trigger the consent popup? #8

Closed sunscreem closed 7 months ago

sunscreem commented 7 months ago

Thanks for making this @ambitiondev.

My client want a separate button added to the site's footer to allow for changing the consent options they have already selected.

Is this possible in the Vue version?

bnachtweh commented 7 months ago

Hi @sunscreem, at the moment this is not possible. I will add this method in the next release. Stay tuned!

bnachtweh commented 7 months ago

@sunscreem in the latest version (3.1.0) you can use the renew method (for both Vue and Nuxt plugin) like so:

<script setup lang="ts">
const { renew } = useCookiebot();
</script>

<template>
  <div>
    <button @click="renew">renew</button>
  </div>
</template>

If you're using Vue, you'll need an import statement for the composable

sunscreem commented 7 months ago

@bnachtweh Massive thanks Sir! Already in and working a treat.

Thanks again.