Home

Awesome

svg-progress-bar

A simple,progress bar for Vue.js

Build Status LICENSE MIT

<p align="center"> <img src="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2176389216,1520905711&fm=27&gp=0.jpg" width="350"/> </p> <p align="center"> 🐾<a href="http://chenxuan1993.gitee.io/component-document/index_prod#/component/svg-bar-default">online demo</a> | 🌾 <a href="https://chenxuan0000.github.io/svg-progress-bar/" target="_blank">simple demo</a> | πŸ“˜ <a href="./document/README.md">Chinese Document</a> </p>

Browser support

<img src="https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/edge.png" alt="IE" width="16px" height="16px" /></br>IE<img src="https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/firefox.png" alt="Firefox" width="16px" height="16px" /></br>Firefox<img src="https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/chrome.png" alt="Chrome" width="16px" height="16px" /></br>Chrome<img src="https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/safari.png" alt="Safari" width="16px" height="16px" /></br>Safari<img src="https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/safari-ios.png" alt="iOS Safari" width="16px" height="16px" /></br>iOS<img src="https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/chrome-android.png" alt="Chrome for Android" width="16px" height="16px" /></br>Android
IE9+βœ“βœ“βœ“βœ“βœ“

What is svg-progress-bar?

svg-progress-bar is a based on circles of the secondary development of project vue components

Features

Installation

NPM

npm install svg-progress-bar --save

Usage

ES6

Specific reference example-src/App.vue

// **main.js**
import Vue from 'vue'
import svg from 'svg-progress-bar'
// you can set componentName default componentName is svg-progress-bar
Vue.use(svg,{componentName: 'percent-bar'})
// 1.global install
import Vue from 'vue'
import svg from 'svg-progress-bar'
// you can set custom componentName
Vue.use(svg,{componentName: 'percent-bar'})

// 2.single .vue file install
<script>
  import svg from 'svg-progress-bar'
   export default {
      components: {
        svg
      }
   }
</script>

s

normal use (script tag)

Example:

Specific reference test/test.html

<html>
<head>
  ...
</head>
<body>
  <div id="app">
    <svg-progress-bar></svg-progress-bar>
  </div>
  <script src="vue.js"></script>
  <script src="svg-progress-bar"></script>
  <script>
    new Vue({
      el: '#app'
    })
  </script>
</body>
</html>

Configure list

keydescriptiondefaultval
typetype of the progress bar'circle''circle' 'rect'
valuevalue of the progress bar0Number String
valAddCalBackvalAddCalBack of the progress bar[][{value: 20,func: () => {this.dotValArr.per20 = 20}},{value: 40,func: () => {this.dotValArr.per40 = 40}}]
optionsoptions of the progress bar{}Object
options.valRatevalue add Rate of the circle progress bar(suggest <= 1)1Number
options.radiusradius of the circle progress bar50Number
options.circleWidthstokeWidth of the circle progress bar10Number
options.varyStrokeArrayvaryStrokeArray of the circle progress bar if you want wide rangingnullArray
options.circleLinecapcircleLinecap of the circle progress bar'''round',''
options.maxValuemaxValue of the progress bar100Number
options.texttext of the progress barfunction (value) {return this.htmlifyNumber(value)}Function
options.textColortext color of the progress bar#000color
options.pathColorspathColors of the progress bar['#EEE', '#F00']Array
options.gradientColorgradientColor of the progress barnullArray
options.gradientOpacitygradientOpacity of the progress bar[1,1]Array
options.durationduration of the progress bar500Number
options.rectWidthrectWidth of the rect progress bar400Number
options.rectHeightrectHeight of the rect progress bar40Number
options.rectRadiusrectRadius of the rect progress bar0Number

Changelog

See the GitHub release history.

License

svg-progress-bar is open source and released under the MIT License.