How to set itemWidth in Buefy carousel component?

nigelwhite

I am using Buefy Carousel List from https://buefy.org/documentation/carousel#carousel-list in a Gridsome single file component. I need to change the width of the slides from the default (476.25) to the width of my own images (176).

In Vue dev tools, I can manually override the data prop itmeWidth. This displays correctly and Vue dev tools shows that the computed prop has been changed to itemStyle: "width: 176px;"

How do I code the new width into the component? I have tried via styling (.carousel-slide width: 176px), data props (itemWidth: 176) and computed props (itemStyle: "width: 176px;"). All are ignored and the default width is applied.

Ezra Siton

No API option/support for custom width slide set by CSS (Example: On swiper slidesPerView: auto is API option for this idea - see swiper demos).

https://buefy.org/documentation/carousel/#api-view

For carousel list the width added by Javascript (Inline CSS) - Example:

enter image description here

Anyway, !important; will change the width (Output: broken layout).

.carousel-item{
  width: 176px!important;
}

items-to-show

One more idea/option for custom width: Use items-to-show and decimal (3.2 for example).

enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to set component default props on React component

element Ui: Carousel - How to set current slide

How to avoid reactive tables in Buefy

How to set state on child component?

Can't access Buefy component inside .beforeEach()

How to implement PrimeNG styleclasses in Angular in order to customize the carousel component?

How to set `contextType` on stateless component

How to handle carousel buttons from Angular component in ngx-slick-carousel

How to set component property programmatically in Vuetify component

How to set ItemWidth to "auto" in ItemsWrapGrid

how to add reactstrap carousel as child component directly or using async?

how to set tabs on carousel bootstrap4

How to set scope for AngularJS component

Buefy vertical thumbnails carousel?

How to set the zIndex on the drawer component

How to customize controls and indicators in BootstrapVue's Carousel component?

How to set width of responsive carousel?

How to set the value of a component to a number

Simple Carousel Component in React

How to set p:carousel width to 100%?

How to hide overflow on a carousel slider and set a loop

Angular bootstrap Carousel- How to move to next image of ng-bootstrap carousel in an angular component?

How can I implement Owl Carousel in react without use the Owl Carousel 2 component?

How to make this Bootstrap Carousel into reusable Razor component to use in Blazor app

Update Buefy component using JavaScript..VueJs

Buefy carousel template slot indicator showing broken image

How do I add a transition to this help text in Buefy's Field component?

How to add @click event to the Buefy image

How to dynamic set element's class depending on Buefy breakpoint