Brand List
Documentation: Brand List Component
model
object, which controls the appearance and functionality.Overview
Model Documentation
model
object to configure its behavior and appearance. Here's a breakdown of the properties used in the model
:Model Structure
model
object should have the following properties:String
A unique identifier for the component. This is used for the component’s
id
attribute and can be used for styling or targeting the component with JavaScript.String
Optional CSS class(es) for the outer container. This allows for additional styling.
String
Optional header text to be displayed at the top of the list. This text is rendered as an
<h2>
element.Number
Controls the alignment of the header text. Possible values are:
1
: Left alignment (justify-content-start
)2
: Center alignment (justify-content-center
)3
: Right alignment (justify-content-end
)Array
An array of brand IDs used to fetch brand data.
Example Model
model
object:{
"id": "brands-list-1",
"cssClass": "custom-brand-list",
"header": "Our Brands",
"alignment": 2,
"brandIds": ["brand1", "brand2", "brand3", "brand4"]
}
Component Structure
1.
2.
HTML Template
BrandList
data:
JavaScript
Explanation
1.
model
object as a prop, which contains configuration and data used for rendering.2.
model
object.3.
4.
_findBrandsByIds
method and updates the BrandList
with the fetched data.Steps to Create Your Own Brands List 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.mounted()
lifecycle hook to fetch and set brand data.4.
5.
6.