question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: Slide component does not load when carousel's parent component is imported 0.6.8

See original GitHub issue

Hello, I ran into an odd issue where the Carousel doesn’t display until I click on where the slide would be or trigger a pageChange by clicking on a pagination icon. Even stranger is that the elements are all there in the markup, but they won’t display until i click in the general area of the slider.

This only seems to occur when I import the components into another component that is being imported as well.

import Vue from 'vue'
import ProductOverview from './components/product-overview.vue'

const app = document.getElementById("app")

new vue({
  el: app,
  template: "<ProductOverview />",
  components: { ProductOverview }
})
<template>
<div class="product">
  <product-images></product-images>
  <product-form></product-form>
</div>
</template>

<script>
import ProductImages from "./product-images.vue";
import ProductForm from "./product-form.vue";

export default {
  components: {
    ProductImages,
    ProductForm
  }
};
</script>
  
<template>
  <carousel>
    <slide>
      <img src="https://placehold.it/600x400">
    </slide>
    <slide>
      <img src="https://placehold.it/600x400">
    </slide>
  </carousel>
</template>

<script>
import { Carousel, Slide } from "vue-carousel";

export default {
  components: {
    Carousel,
    Slide
  }
};
</script>

Here are some screenshots as well.

initial-load

I click on one of the pagination circles:

after-click

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:31 (10 by maintainers)

github_iconTop GitHub Comments

13reactions
deakpalcommented, Sep 4, 2018

I had the same problem, and my solution is:

mounted() {
  setTimeout(() => {
    this.$refs['carousel'].onResize();
    this.$refs['carousel'].goToPage(0);
  }, 200);
}
12reactions
DavidVIIcommented, May 8, 2018

@nchlodzi indeed an unfortunate bug, but I believe this may be solved with #172. However, I’m not entirely sure.

I was able to get some results with by setting the VueCarousel-slide style to this:

.VueCarousel-slide {
  visibility: visible;
  flex-basis: 100%;
  width: 100%;
}

Try that instead of the VueCarousel-inner

It’s a workaround, but it should display the slides by default with that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can I reference component props to get from parent when I ...
I am working o a project with multiple carousels. so I decided to create a carouselitem.js component, a carousel.js component that includes ...
Read more >
Bootstrap Vue Carousel Does Not Work When Imported As ...
A slideshow component for cycling through elementsimages or slides of the carousel will avoid sliding when the webpage is not visible to the...
Read more >
ng-zorro-antd | Yarn - Package Manager
An enterprise-class UI design system for Angular applications. 60+ high-quality Angular components out of the box. Written in TypeScript with predictable static ...
Read more >
stream-chat-react - UNPKG
node_modules/html-to-react/lib/should-process-node-definitions.js",". ... node_modules/emoji-mart/dist-es/components/not-found.js",".
Read more >
Untitled
Jack's mannequin the mixed tape mp3, 8 week embryo not growing, ... E/m key components, Chemical biological interactions, Glee whistle lyrics, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found