# circle-percent-vue

> A circular ring component used to represent a percentage for Vue2.x.

Latest version **0.0.3** (published 2018-06-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install circle-percent-vue
pnpm add circle-percent-vue
yarn add circle-percent-vue
bun add circle-percent-vue
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2018-06-27 |
| First published | 2018-06-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 4.0.0 |
| Dependencies | 0 |
| Unpacked size | 51.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | chenxingxing |
| Maintainers | chenmiao1016 |
| Keywords | vue, vue2, circle |

## Links

- npm: https://www.npmjs.com/package/circle-percent-vue
- npm.io page: https://npm.io/package/circle-percent-vue

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2018-06-27
- 0.0.2 — 2018-06-27
- 0.0.1 — 2018-06-27

## README

# circle
<!-- 
[![npm package](https://img.shields.io/npm/v/circle-percent-vue.svg)](https://www.npmjs.com/package/circle-percent-vue)
[![NPM downloads](http://img.shields.io/npm/dm/circle-percent-vue.svg)](https://www.npmjs.com/package/circle-percent-vue)
[![GitHub issues]()]()
[![Travis]()]()

[![NPM](https://nodei.co/npm/circle-percent-vue.png)](https://nodei.co/npm/circle-percent-vue/) -->

> A circular ring component  used to represent a percentage for Vue2.x.


<!-- ![c-swipe](https://raw.githubusercontent.com/pspgbhu/pspgbhu.github.io/master/assets/img/cswipe-demo.gif) -->
 

## Install
`npm install  circle-percent-vue  --save`

## Usage

register components:

```js
// main.js

// import cir-swipe files into main.js
import 'circle-percent-vue/dist/circle.css';
import { Swipe, SwipeItem,circlePercent } from 'circle-percent-vue';

// global register components
Vue.component('swipe', Swipe);
Vue.component('swipe-item', SwipeItem);
Vue.component('circle-percent', circlePercent);

```

Use in `.vue` files.



```html
  // value is percent ;
 <circle-percent :value="30" ></circle-perfect>
```

```js
new Vue({
  data: function () {
    return {
      index: 0, // two way
    };
  },
});
```

*Or, you want import it by html tag*
```html
<link href="../node-modules/circle-percent-vue/dist/circle.css" rel="stylesheet"></head>
<script type="text/javascript" src="../node-modules/circle-percent-vue/dist/circle.js"></script>
```
```js
var vueSwipe = swipe.Swipe;
var vueSwipeItem = swipe.SwipeItem;

new Vue({
  el: 'body',
  // register components
  components: {
    'swipe': vueSwipe,
    'swipe-item': vueSwipeItem
  }
  // ...
  // ...
});
```


## Options

| Option | Type | Defalut  | Description |
| ------ | ---- | -------- | ----------- |
| v-model| Number | 0 |The value binding index of swipe-item |
| pagination | Boolean | true |If need default pagination.|
| loop | Boolean | true | loop move |
| autoplayTime | Number | 0 | ms. Interval time of change card. The card will not auto change when this value is equal to 0
| speed | Number | 300 | ms, the spend time of change card.
|minMoveDistance | String | '20%' | Such as '20%', '80px'. The minimum distance that trigger to change card

## Methods

- **swipe.reset()**

The cir-swipe internally recalculates the width of the Swipe and calculates the scroll distance based on the new width. This solves the problem that the cir-swipe scroll distance is not correct after the container is resized.

Example:
```jsx
<swipe ref="swipe">
  <swipe-item>item1</swipe-item>
  <swipe-item>item2</swipe-item>
  <swipe-item>item3</swipe-item>
</swipe>

<script>
  export default {
    // ...
    // ...

    handleResize() {
      this.$refs.swipe.reset();
    }

    mounted() {
      // Avoid losing context
      this.handleResize = this.handleResize.bind(this);

      window.addEventListener('resize', this.handleResize);
    },

    destroyed() {
      window.removeEventListener('resize', this.handleResize);
    }

    // ...
    // ...
  }
</script>
 
# License

MIT

---
_Source: https://npm.io/package/circle-percent-vue · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
