Vue Progress Path
Vue Progress Path is a Vue.js 2.x library offering highly customizable progress bars and loading indicators. Its primary differentiator is the ability to render progress shapes using any custom SVG path, alongside built-in options like circles and semicircles, providing extensive design flexibility. The package is currently at version `0.0.2`. Despite its initial promise for versatile progress UIs, the project is explicitly noted as 'Work In Progress' and has not seen any updates or commits in over six years, indicating it is no longer actively maintained. Consequently, there is no ongoing release cadence, and it remains exclusively compatible with Vue 2.x, rendering it unsuitable for modern Vue 3 applications. Users should be aware that no further features, bug fixes, or security patches are anticipated.
Common errors
-
[Vue warn]: Unknown custom element: <loading-progress> - did you register the component correctly?
cause The `VueProgress` plugin was not registered with `Vue.use()`, or the component is being used before the plugin is applied.fixEnsure you have `import VueProgress from 'vue-progress-path'; Vue.use(VueProgress);` in your main application entry point before instantiating your Vue app. -
Failed to resolve component: loading-progress
cause Similar to the Vue warn, this indicates Vue cannot find the component definition. This often happens in a Vue 3 context or if `Vue.use()` was skipped.fixVerify that your project is running Vue 2.x, and that `Vue.use(VueProgress)` is correctly called. For Vue 3, this library is incompatible. -
Module not found: Error: Can't resolve 'vue-progress-path/dist/vue-progress-path.css'
cause The CSS import path is incorrect, or the file does not exist in the specified location (e.g., due to a broken npm install or missing `node_modules`).fixCheck your `node_modules` directory for `vue-progress-path/dist/vue-progress-path.css`. Ensure the import statement is exactly `import 'vue-progress-path/dist/vue-progress-path.css';`.
Warnings
- breaking This project is abandoned. It has not been updated in over six years, and there will be no new features, bug fixes, or security updates. Usage in production environments is not recommended.
- breaking The library is only compatible with Vue 2.x. It does not support Vue 3 and will likely cause runtime errors if used in a Vue 3 application due to breaking API changes in Vue's ecosystem.
- gotcha Being a v0.0.2 release, the API might not be stable, and internal implementation details could be subject to change without prior notice or adherence to semantic versioning. Documentation is sparse, and the 'Work In Progress' status implies potential instability.
- gotcha The component's CSS styles are imported via a separate file (`dist/vue-progress-path.css`). Forgetting this import will result in unstyled, potentially invisible, progress components.
Install
-
npm install vue-progress-path -
yarn add vue-progress-path -
pnpm add vue-progress-path
Imports
- VueProgress
const VueProgress = require('vue-progress-path');import VueProgress from 'vue-progress-path';
- CSS Styles
import 'vue-progress-path/dist/vue-progress-path.js';
import 'vue-progress-path/dist/vue-progress-path.css';
- loading-progress
import { LoadingProgress } from 'vue-progress-path';<loading-progress :progress="value" />
Quickstart
import Vue from 'vue';
import 'vue-progress-path/dist/vue-progress-path.css';
import VueProgress from 'vue-progress-path';
Vue.use(VueProgress);
new Vue({
el: '#app',
data() {
return {
progress: 0,
indeterminate: false,
counterClockwise: false,
hideBackground: false,
};
},
mounted() {
setInterval(() => {
if (this.indeterminate) return;
this.progress = (this.progress + 5) % 105;
if (this.progress >= 100) {
this.progress = 0;
}
}, 200);
},
template: `
<div id="app">
<h1>Vue Progress Path Demo</h1>
<p>Control progress with the input below:</p>
<input type="range" v-model.number="progress" min="0" max="100" /> {{ progress }}%
<br>
<label>
<input type="checkbox" v-model="indeterminate"> Indeterminate
</label>
<label>
<input type="checkbox" v-model="hideBackground"> Hide Background
</label>
<label>
<input type="checkbox" v-model="counterClockwise"> Counter Clockwise
</label>
<h3>Material-like Spinner</h3>
<loading-progress
:progress="progress"
:indeterminate="indeterminate"
:counter-clockwise="counterClockwise"
:hide-background="hideBackground"
size="64"
rotate
fillDuration="2"
rotationDuration="1"
/>
<h3>Semi-circle Progress</h3>
<loading-progress
:progress="progress"
:indeterminate="indeterminate"
:counter-clockwise="counterClockwise"
:hide-background="hideBackground"
shape="semicircle"
size="64"
/>
<h3>Custom SVG Path</h3>
<loading-progress
:progress="progress"
:indeterminate="indeterminate"
:counter-clockwise="counterClockwise"
:hide-background="hideBackground"
shape="M10 80 C 40 10, 65 10, 95 80 S 150 150, 180 80"
size="180"
fill-duration="2"
/>
</div>
`,
});