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 Pakainfo.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 :  PHP Rest API And HTTP CURL methods GET, POST, DELETE, PUT

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 
    }
  }
})

Build an Image Slider with Vue.js

There Are the Following Example of the vuejs image slider.

Also Read :  How to Integrate Google No CAPTCHA reCAPTCHA using VueJS

vue js carousel
vue image carousel
vuejs slideshow

A post on simple Pakainfo.com Vue.js has a link to Pakainfo.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.

new Vue({
    el: 'body',
    data: {
        images: ['http://pakainfo.com/vYdoAKu.jpg', 'http://pakainfo.com/PUD9HQL.jpg', 'http://pakainfo.com/Lfv18Sb.jpg', 'http://pakainfo.com/tmVJtna.jpg', 'http://pakainfo.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.

Also Read :  Codeigniter Helpers Example

<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(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.

Leave a Reply

Your email address will not be published. Required fields are marked *