# @jfm/v-carousel

> A Vue carousel component

Latest version **0.1.0-9** (published 2020-03-20) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @jfm/v-carousel
pnpm add @jfm/v-carousel
yarn add @jfm/v-carousel
bun add @jfm/v-carousel
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.0-9 |
| Published | 2020-03-20 |
| First published | 2020-02-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 1.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jiang Fengming |
| Maintainers | jiangfengming |
| Keywords | vue, carousel, slideshow |

## Links

- npm: https://www.npmjs.com/package/@jfm/v-carousel
- Repository: https://github.com/jiangfengming/v-carousel
- Homepage: https://github.com/jiangfengming/v-carousel#readme
- Issues: https://github.com/jiangfengming/v-carousel/issues
- npm.io page: https://npm.io/package/@jfm/v-carousel

## Dependencies (2)

- [pan-events](https://npm.io/package/pan-events.md) ^0.1.4
- [element-resize-detector](https://npm.io/package/element-resize-detector.md) ^1.2.1

## Alternatives

- [adhdev](https://npm.io/package/adhdev.md) — 11.1K weekly downloads
- [react-slide-button](https://npm.io/package/react-slide-button.md) — 310 weekly downloads
- [better](https://npm.io/package/better.md) — 42 weekly downloads
- [react-native-swipe-image](https://npm.io/package/react-native-swipe-image.md) — 22 weekly downloads
- [nl.fokkezb.pulltorefresh](https://npm.io/package/nl.fokkezb.pulltorefresh.md) — 11 weekly downloads

## Recent versions

- 0.1.0-9 (latest) — 2020-03-20
- 0.1.0-8 — 2020-03-13
- 0.1.0-7 — 2020-03-12
- 0.1.0-6 — 2020-03-11
- 0.1.0-5 — 2020-03-11
- 0.1.0-4 — 2020-02-26
- 0.1.0-3 — 2020-02-26

## README

# @jfm/v-carousel
A Vue carousel component.

## Demo
[https://jiangfengming.github.io/v-carousel/demo/](https://jiangfengming.github.io/v-carousel/demo/)

[Source code](https://github.com/jiangfengming/v-carousel/blob/master/demo-src/App.vue)

## Install
```
npm i @jfm/v-carousel
```

## Usage
```html
<template>
  <main>
    <v-carousel class="carousel" :current-page.sync="currentPage" :total-pages.sync="totalPages" autoplay>
      <v-slide class="slide">slide 1</v-slide>
      <v-slide class="slide">slide 2</v-slide>
      <v-slide class="slide">slide 3</v-slide>
    </v-carousel>

    <button @click="currentPage = currentPage === 1 ? totalPages : currentPage - 1">backward</button>
    <button @click="currentPage = currentPage === totalPages ? 1 : currentPage + 1">forward</button>
  </main>
</template>

<script>
import { VCarousel, VSlide } from '　@jfm/v-carousel'

export default {
  components: { VCarousel, VSlide },

  data: () => ({
    currentPage: 1,
    totalPages: 1
  })
}
</script>

<style scoped>
.carousel {
  width: 400px;
  height: 300px;
}

.slide {
  width: 100%;
  height: 100%;
}
</style>
```

## \<v-carousel> options
* `current-page.sync`: `Number`. Current page number.
* `total-page.sync`: `Number`. Total page count.
* `autoplay`: `Boolean` or `Number` (milliseconds). If `true`, it defaults to 3000.
* `direction`: `String`. `horizontal`, or `vertical`.
  
## License
[MIT](LICENSE)

---
_Source: https://npm.io/package/@jfm/v-carousel · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
