- Install using npm:
npm install CorpGlory/vue-progress-list
- Import the component:
import VueProgressList from 'vue-progress-list';
- Import styles in main project file (
src/main.js
/src/main.ts
):import 'vue-progress-list/dist/vue-progress-list.css';
- Register the component globally or in a separate component
<template>
<vue-progress-list
:items="[
{ title: 'Foo', value: 20, backgroundColor: 'green' },
{ title: 'Bar', value: 80, backgroundColor: 'red' }
]"
:config="{ maxValue: 100 }"
/>
</template>
...
Result:
items
— (required) array of configs for each progress bar, e.g:
:items=[
{ title: 'Foo', value: 1, backgroundColor: 'green' },
{ title: 'Bar', value: 100, backgroundColor: 'red' }
]
config
— (required) progress-list config, e.g:
:config={ maxValue: 100 }
maxValue
- (optional) maximum of item`s value, e.g:
:maxValue=100
opacity
- (optional) css stype for progress bars, e.g:
:opacity=0.5
stops
- (optional) config with stop values and colors, eg:
:stops={
values: {
upperValue: 60,
lowerValue: 20
},
colors: {
high: 'red',
medium: 'yellow',
low: 'green'
}
}
Result:
valueFormat
- (optional) format of item`s values, 'persentage' or 'absolute', eg:
:valueFormat='absolute'
npm install
npm run serve
npm run build