vue js image slider – carousel multiple image slider with thumbnail

vue js image slider – carousel multiple image slider with thumbnail

In this Post We Will Explain About is vue js image slider – carousel multiple image slider with thumbnail With Example and Demo.Welcome on Live24u.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to vue js image slider with thumbnail Example

In this post we will show you Best way to implement vue js carousel multiple items, hear for Creating a Slide Show Plugin With Vue jswith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.




Image Slider Component Example

This example simple mainly showcases the some omages spec-compliant multiple slides insertion points implementation.

Also Read :   Insert,Update, Delete using Angular js in ASP.NET MVC

HTML

<div id="liveApp">
  <div class="buttons">
    <button
      @click="DeleteSlieds"
      :disabled="images <= 2"
    >Remove Slide</button>
    <button
      @click="createnewslide"
      :disabled="images >= 10"
    >Add Slide</button>
  </div>
  <div class="images">
    <transition-group 
      name="slide"
      mode="out-in"
      enter-class="slide-in"
      leave-class="slide-out"
      enter-active-class="animated slide-in-active"
      leave-active-class="animated slide-out-active"
    >
      <div
        v-for="imgObj in images"
        v-if="imgObj == active"
        :key="imgObj"
      >
        Slide {{ imgObj }}
      </div>
    </transition-group>
  </div>
  <span
    class="prev"
    @click="move(-1)"
  >
    <i class="fa fa-chevron-left" aria-hidden="true"></i>
  </span>
  <span
    class="next"
    @click="move(1)"
  >
    <i class="fa fa-chevron-right" aria-hidden="true"></i>
  </span>
  <ul class="dots">
    <li 
      v-for="(dot, imgObj) in images"
      :class="{ active: ++imgObj === active }"
      @click="directCall(imgObj)"
    ></li>
  </ul>
</div>

Javascript


var liveApp = new Vue({
  el: '#liveApp',
  data: {
    images: 5,
    active: 1
  },
  methods: {
    move(amount) {
      let currentActive
      const cIndobj = this.active + amount
      if (cIndobj > this.images) currentActive = 1
      if (cIndobj === 0) currentActive = this.images
      this.active = currentActive || cIndobj
    },
    directCall(imgObj) {
      this.active = imgObj
    },
    createnewslide() {
      this.images = this.images + 1
    },
    DeleteSlieds() {
      this.images = this.images - 1 
    }
  }
})




Also Read :   HTML5 Vuejs Based Audio Player Application

Build an Image Slider with Vue.js

There Are the Following Example of the vuejs image slider.

vue js carousel
vue image carousel
vuejs slideshow

A post on simple live24u.com Vue.js has a link to live24u.com where there is a most useful tutorial with detailed with source code explanations to help you simple build an image slider using Vuejs and HTML. we are only going to need simple Vue and not any add external extra plugins.

Get started

Create a new Vue simple object and fill an all the json array with all images to show. We use a some variable to keep the slides like as a current active image.

Also Read :   Angularjs Scroll to top With Router Autoscroll

new Vue({
    el: 'body',
    data: {
        images: ['http://live24u.com/vYdoAKu.jpg', 'http://live24u.com/PUD9HQL.jpg', 'http://live24u.com/Lfv18Sb.jpg', 'http://live24u.com/tmVJtna.jpg', 'http://live24u.com/ZfFAkWZ.jpg'],
        firstActiveNum: 0
    }
});

We can show the first image of the all the array by using the HTML img tag, HTML bind the simple images src attribute to the images all the array and use the some variable We have set to Display the first images in the array.

<body>
    <img :src="images[firstActiveNum]" />
</body>





Example

I hope you have Got What is vue js carousel responsive And how it works.I would Like to have FeadBack From My Blog(live24u.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(live24u.com) Are Most Always Welcome.