dargmuesli / nuxt-cookie-control

A highly configurable cookie banner for Nuxt.
MIT License
251 stars 46 forks source link

Cookie Links to route to page (using NuxtLink) #197

Closed mouldt closed 8 months ago

mouldt commented 8 months ago

Describe the feature

At present we can have links for cookies where more information can be provided. Whether you configure this with a page route e.g. /MyCookiePolicy or an external route e.g. http://mysite/cookiepolicy the link is always rendered using an tag, which means Nuxt will perform a full page load. If would be nice if we could use Nuxt/Vue routing to close the CookieDialog and perform a Page navigation.

The fix could be something like this in the modal dialog: <NuxtLink v-if="!entry[0].startsWith('http')" :to="entry[0]" @click="isModalActive = false"

{{ entry[1] || entry[0] }}</NuxtLink

{{ entry[1] || entry[0] }}

i.e. if its not an external link use Nuxt/Vue routing otherwise use the tag and treat the link as external.

Additional information

  • [X] Would you be willing to help implement this feature?

Final checks

dargmuesli commented 8 months ago

Sounds good to me, no potential issues come to my mind right now. PR welcome!

dargmuesli commented 8 months ago

:tada: This issue has been resolved in version 8.0.0-beta.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

dargmuesli commented 8 months ago

:tada: This issue has been resolved in version 8.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: