aacassandra / vue3-progressbar

https://www.npmjs.com/package/@aacassandra/vue3-progressbar
MIT License
55 stars 14 forks source link

How to use with composition api? #1

Closed hi-reeve closed 3 years ago

hi-reeve commented 3 years ago

is there any example how to use this with composition api? whatt should we import?

aacassandra commented 3 years ago

on your vue file you can import your main.js/app.js file like bellow

for example on the my App.vue

<template>
    <div>
        <router-view />
        <vue-progress-bar></vue-progress-bar>
    </div>
</template>
<script>
import Vue from '@/app';

export default {
    setup() {
        Vue.config.globalProperties.$Progress.start();
    }
};
</script>
jorge-precich commented 1 year ago

How to replicate the $router.beforeEach from the old style? I realized there is a setTimeOut on the new style which does not accomplish the same when doing the $Progress.start()