- Notifications
You must be signed in to change notification settings - Fork3
Slim progress bars for Vue 3.
License
NotificationsYou must be signed in to change notification settings
jambonn/vue-next-progressbar
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Slim progress bars for Vue 3.
npm install @jambonn/vue-next-progressbar
or if you prefer yarn
yarn add @jambonn/vue-next-progressbar
You may install Vue next progressbar globally:
import{createApp}from'vue';import{createRouter,createWebHistory}from'vue-router';importVueNextProgressbarfrom'@jambonn/vue-next-progressbar';importAppfrom'./App.vue';constapp=createApp(App);app.use(createRouter({history:createWebHistory(),routes:[],}));app.use(VueNextProgressbar,{router:true});app.mount('#app');
When install global Vue next progressbar, you can control progress in component
<template> <buttontype="button"@click="progressBar.start()">Shows the progress bar</button> <buttontype="button"@click="progressBar.done()">Completes the progress</button></template><script>import {getCurrentInstance,inject }from'vue';exportdefault {setup() {// Get from global propertiesconstapp=getCurrentInstance();constprogressBar=app.appContext.config.globalProperties.$Progressbar;// Get from provideconstinjectProgressBar=inject('Progressbar');return { progressBar, injectProgressBar } }}</script>
Simply call start() and done() to control the Vue next progress bar.
import{VueProgressbar}from'@jambonn/vue-next-progressbar';VueProgressbar.start();VueProgressbar.done();
Adjust how often to trickle/increment, in ms.
import{createApp}from'vue';importVueNextProgressbarfrom'@jambonn/vue-next-progressbar';importAppfrom'./App.vue';constapp=createApp(App);constoptions={trickleSpeed:500,// default: 800};app.use(VueNextProgressbar,options);
yarn installyarn dev
then navigate tohttp://localhost:8080
yarn buildThis project is licensed under the MIT License - see theLICENSE file for details.
About
Slim progress bars for Vue 3.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.