Giter Club home page Giter Club logo

Comments (3)

prezmix avatar prezmix commented on May 18, 2024

I have solved my error by using this approach instead.

<b-carousel id="infoscreen-carousel" :interval="3000" :indicators="false" :controls="false">
        <b-slide v-for="n in 10">
          <template v-if="events[n]">
            <div class="carousel-image">
              <img v-if="events[n].image" v-bind:src="events[n].image.raw" v-bind:alt="events[n].title" v-bind:title="events[n].title">
            </div>
            <div class="carousel-desc">
              <h2><a v-bind:href="events[n].url">{{ events[n].title | truncate(88) }}</a></h2>
              <p>
                <span>{{ events[n].all_oist_category }}</span>
                <span v-if="events[n].location">{{ events[n].location }}</span>
                <span>{{ events[n].start_date | unixToString }}</span>  
              </p>
              <p>{{ events[n].summary | cleanString | truncate(176) }}</p>
            </div>
          </template>
        </b-slide>
      </b-carousel>

Any comments would still be appreciate as to the correct approach.

Thank you

from bootstrap-vue.

pi0 avatar pi0 commented on May 18, 2024

Closing this as is a little old. Official carousel component support will be in next releases :)

from bootstrap-vue.

flip111 avatar flip111 commented on May 18, 2024

I tried to do the same by taking the carousal from the documentation and put the image links in the data section.

<template>
  <b-row>
    <b-col>
      <b-carousel id="carousel1"
                  style="text-shadow: 1px 1px 2px #333;"
                  controls
                  indicators
                  background="#ababab"
                  :interval="4000"
                  img-width="1024"
                  img-height="480"
                  v-model="slide"
                  @sliding-start="onSlideStart"
                  @sliding-end="onSlideEnd"
      >

        <b-carousel-slide v-for="image in images" v-bind:img-src="image"></b-carousel-slide>

      </b-carousel>

      <p class="mt-4">
        Slide #: {{ slide }}<br>
        Sliding: {{ sliding }}
      </p>

      <div v-for="image in images">{{image}}</div>
    </b-col>
  </b-row>
</template>

<script>
export default {
  data () {
    return {
      images:
      [ 'https://lorempixel.com/1024/480/technics/2/'
      , 'https://lorempixel.com/1024/480/technics/8/'
      , 'https://lorempixel.com/1024/480/technics/5/'
      ]
    }
  }
}
</script>

<style scoped>
</style>

The v-for works fine for this line <div v-for="image in images">{{image}}</div> but with the b-carousel-slide tag i get

(Emitted value instead of an instance of Error) <b-carousel-slide v-for="image in images">: component lists rendered with v-for should have explicit keys. See https://vuejs.org/guide/list.html#key for more info.

Is there something in the carousel component that i need explicit keys now? (the carousel works though) How is this different than a regular div?

edit: changing

                  img-width="1024"
                  img-height="480"

to smaller sizes seems to have no effect

from bootstrap-vue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.