HomeWiki
HomeWiki
  1. Components
  • Back to home
  • 1. Themes
  • Layout
    • New Layout
    • Legacy Layout
  • Components
    • Announcement
    • Banner Carousel
    • Banner With Products Carousel
    • Blog Category List
    • Blog List
    • Brand List
    • Brands Carousel
    • Breadcrumb
    • Call To Action
    • Cart
    • Categories List
    • Change Password
    • Checkout
    • Cookie Manager
    • Filter list
    • Footer
    • Forgot Password
    • Form
    • Hero Carousel
    • Icon Block
    • Invitation
    • Last Visited Products
    • Layout
    • Login
    • Map
    • Nav Bar
    • Offer
    • Product Attachments
    • Product Attributes
    • Product Documentation
    • Product Expected
    • Product Modal
    • Products Block
    • Products Carousel
    • Product Single
    • Profile
    • Quote
    • Register
    • Related Products
    • Search
    • Stores
    • Subscribe Newsletter
    • Text with Image
    • Top Bar
    • Video
  • Reusables
    • Getting Started
  • Assets
    • Getting Started
  • SDK
    • Products
      • _findProductsByCategory
      • _findProductsByIds
      • _findProductsByTitle
      • _findProductsByFilter
      • _findProductsByCriteria
      • _findProductsAndCalculate
      • _findProductsThenCalculate
      • _getProductAttributeSet
      • _setLastVisited
    • Categories
      • _findCategoryTreeById
      • _findCategoriesByIds
      • _findCategoryByAlias
      • _findCategoryTreeByAlias
      • _getCategoryContent
    • Collections
      • _getCollectionContent
      • _findCollectionsByIds
      • _findCollectionsByIdsThenCalculate
    • Brands
      • _getBrandContent
      • _findBrandsByIds
    • Cart
      • _addToCartMulti
      • _addToCart
      • _setCart
      • _clearCart
      • _setCartListener
      • _removeFromCart
      • _calculateCart
    • Checkout
      • _startCheckout
      • _updateCheckout
      • _completeCheckout
    • Shopping Lists
      • _getShoppingLists
      • _updateShoppingList
      • _createShoppingList
      • _deleteShoppingList
      • _getShoppingListByAlias
    • Navigation
      • _getFooterMenu
      • _getHeaderMenu
    • Users
      • _getUserById
    • Utils
      • _calculateCurrency
      • _getCurrencySymbol
      • _getCulture
      • _subscribeToNewsletter
      • _findUnitsByIds
  • Vs Code
    • Getting Started
  1. Components

Brands Carousel

Documentation: Brands Carousel Component#

This documentation covers the Brands Carousel Component, a Vue.js component designed to display a list of brand logos in a responsive carousel format. The component allows for dynamic styling and layout based on the provided model.

Overview#

The Brands Carousel Component displays a carousel of brand logos. The carousel adapts to different screen sizes and configurations, showcasing brand images or names.

Model Documentation#

The Brands Carousel Component relies on a model object that defines its behavior and appearance. Here's a detailed look at the model properties:
Model Structure#
The model object contains the following properties:
id: String
The unique identifier for the component, used for styling and referencing the component.
cssClass: String
Optional CSS class(es) for styling the outer container of the carousel. Allows for custom styling.
header: String
Optional header text to display above the carousel. This is rendered as an <h2> element.
alignment: Number
Defines the alignment of the header text. Possible values are:
1: Left aligned (justify-content-start)
2: Center aligned (justify-content-center)
3: Right aligned (justify-content-end)
brandIds: Array
An array of brand IDs used to fetch the brand data.
Example Model#
Here is an example of what the model object might look like:
{
  "id": "brands-carousel-1",
  "cssClass": "custom-carousel",
  "header": "Our Trusted Brands",
  "alignment": 2,
  "brandIds": ["brand1", "brand2", "brand3", "brand4", "brand5"]
}

Component Structure#

The component is defined in Vue.js with the following features:
1.
HTML Template: Defines the structure and layout of the carousel and brand items.
2.
JavaScript Logic: Manages data, methods, and lifecycle hooks.

HTML Template#

Here is the HTML structure for the Brands Carousel Component:

JavaScript#

The JavaScript file manages the component's data, methods, and lifecycle hooks:

Steps to Create Your Own Brands Carousel Component#

1.
Set Up the Vue Component:
Define the component using Vue.component() or app.component().
Specify the HTML template using the template option.
2.
Create the Template:
Structure your HTML to include the carousel layout and brand items.
Use Vue.js directives (v-if, v-for, :class, etc.) to bind data and control rendering.
3.
Implement the JavaScript Logic:
Define props to receive the model data from parent components.
Use data() to initialize component state.
Implement mounted() to fetch brand data based on brandIds.
Write methods to initialize the carousel and handle dynamic alignment classes.
4.
Integrate External Libraries:
Ensure you have included any required libraries for carousel functionality and styling.
5.
Testing and Debugging:
Test the component in various scenarios to ensure proper functionality and responsiveness.
Debug any issues related to data binding, component rendering, or styling.
6.
Deploy the Component:
Once tested, deploy the component as part of your Vue.js application.
This guide provides a template for creating a custom Brands Carousel component in Vue.js. Customize the HTML and JavaScript according to your specific requirements and integrate any additional features as needed.
Previous
Brand List
Next
Breadcrumb
Built with