1.0.3-beta • Published 4 years ago

@deviznet/vue-product-360 v1.0.3-beta

Weekly downloads
7
License
-
Repository
github
Last release
4 years ago

🎆 Vue Product 360

Loop a series of images in a 360 rotatation carousel with this plugin for Vue.js

Demo Screenshot

▶️ Try the demo or ▶️ Start a sandbox (available soon)

Installation

Quick start guide for installing and configuring the plugin

# Using npm
npm install @deviznet/vue-product-360

# Using yarn
yarn add @deviznet/vue-product-360

Usage

<template>
  <VueProduct360 :images="images">
    <p>Loading</p>
  </VueProduct360>
</template>

<script>
  import VueProduct360 from 'vue-product-360'

  export default {
    data() {
      return {
        images: ['img1.png', 'img2.png', 'img3.png'],
      },
    },
    components: {
      VueProduct360,
    },
  };
</script>

🏷 Props

NameTypeIs RequiredDefault ValueDescription
imagesArray[String]required[]Array of images to be looped
speedNumberoptional10Rotation speed
infiniteBooleanoptionaltrueInfinite loop
reverseBooleanoptionalfalseChange the rotation direction
disabledBooleanoptionalfalseDisabled the rotation
image-classStringoptionalnullCustom CSS class for the image tag
keep-positionBooleanoptionaltrueWhen the images prop change, the plugin keep the current position. Otherwise, the carousel slide to the first image

🤖 Events

NameDescription
loadingImages are currently downloading
loadedAll images are downloaded
startingThe rotation started with the following events: mousedown or touchstart
stoppingThe rotation is stopped
refreshingWhen the images prop changed, the carousel is refreshing and reload the images.
refreshedAll images are downloaded

⚙️ Methods

slideToRight()

Slide the carousel to the right. If the loop is complete and if the infinite props is set to true, the carousel slide to the first images.

slideToLeft()

Slide the carousel to the left. If the loop is complete and if the infinite props is set to true, the carousel slide to the last images.

slideTo(position)

Slide the carousel to a specific position