vue-cookieconsent-component
Vue Cookieconsent
Demo
Install
npm install vue-cookieconsent-component
or yarn add vue-cookieconsent-component
Usage
The most common use case is to register the component globally.
// in your main.js or similar file Vue
Alternatively you can do this to register the components:
// HelloWorld.vue name: 'HelloWorld' components: CookieConsent
On your page you can now use html like this:
// see slots or props if you want to extend something
CSS
// required and to get updates ;// example or use it ;;
Do you like my theme but not the colors or paddings, ...?
// overwrite variables ;;;// find more variables in /src/scss/_cookie-consent-variables.scss ;
Props
Prop | Type | Required | Default | Description |
---|---|---|---|---|
transition | String | false | cookie-consent-transition | Transition name |
message | String | false | This website uses... | Main message |
linkLabel | String | false | Learn more | Link label |
buttonLabel | String | false | Got it! | Button label |
href | String | false | http://cookiesandyou.com | Target link |
target | String | false | _blank | New window |
rel | String | false | noopener | Referrer Policy |
cookieName | String | false | cookieconsent_status | Cookie name |
cookiePath | String | false | / | Cookie path |
cookieDomain | String | false | '' | Cookie domain |
cookieExpiryDays | Number | false | 365 | Cookie expiry days |
Slots
Name | Description |
---|---|
message | Message and link |
link | Only the link |
button | Only the button |
Slots example
Create your own content
This website uses cookies Read more Accept
Build Setup
# install dependenciesnpm install# serve with hot reload at localhost:8080npm run dev# build for production with minificationnpm run build# build for production and view the bundle analyzer reportnpm run build --report# run unit testsnpm run unit# run all testsnpm test