eyecatchup/vue-cookieconsent

Struggling to get this to work using Vue 3 with script setup

pedropaes opened this issue · 0 comments

Can't get the banner to show up, i'm following the code example but i'm struggling with this part

export default defineComponent({ name: 'Foo', beforeCreate () { this.$cc.on('consent-changed', () => { console.log('cookie consent changed, new user preferences:', this.$cc.getUserPreferences()) // your business logic.. }) } })

Tried to put it inside a component but it has no render function, so i'm trying to access the $cc instance like this:
getCurrentInstance()!.appContext.config.globalProperties.$cc
But I can't get it to show up, maybe i'm missing some configuration.
Could someone point me to a working example?