Cookie Manager
Documentation: CookieManager Component
Overview
1.
2.
Model Documentation
model
object to control its behavior and appearance. Here's a breakdown of the properties used in the model
:Model Structure
model
object should include the following properties:String
A unique identifier for the component. This is used for the component’s
id
attribute and for targeting the component with JavaScript.Date
The date when the cookie consent will expire. This is used to determine how long the consent preferences are valid.
Array
An array of cookie blocks, where each block represents a category of cookies with its details.
Example Model
model
object:{
"id": "cookie-manager",
"expirationDate": "2024-12-31T23:59:59Z",
"blocks": [
{
"title": "Analytics Cookies",
"toggle": {
"isEnabled": false,
"cookieCategory": "analytics",
"isReadOnly": false
},
"rows": [
{
"columnNames": [
{ "title": "Name", "description": "Google Analytics" },
{ "title": "Domain", "description": "example.com" },
{ "title": "Usage", "description": "Analytics" },
{ "title": "Expiration", "description": "2 years" }
]
}
]
}
]
}
Component Structure
1.
2.
HTML Template
model
data:
JavaScript
Explanation
1.
model
object as a prop, containing configuration and data used for rendering the cookie consent banner and settings modal.2.
3.
4.
Steps to Create Your Own CookieManager Component
1.
Vue.component()
or app.component()
to register the component.2.
v-if
, v-for
, :class
, etc.) for dynamic rendering.3.
props
for the model
object.