vue3-progressbar icon indicating copy to clipboard operation
vue3-progressbar copied to clipboard

How to make it work on every page?

Open otabekoff opened this issue 2 years ago • 1 comments

It is working when I refresh only. Not working when url changes.

otabekoff avatar Jul 12 '22 11:07 otabekoff

Hi. You can use it like this: In the App.vue copy and paste this:- `

// [App.vue specific] When App.vue is first loaded start the progress bar this.$Progress.start() // hook the progress bar to start before we move router-view this.$router.beforeEach((to, from, next) => { // does the page we want to go to have a meta.progress object if (to.meta.progress !== undefined) { let meta = to.meta.progress // parse meta tags this.$Progress.parseMeta(meta) } // start the progress bar this.$Progress.start() // continue to the next page next() }) // hook the progress bar to finish after we've finished moving router-view this.$router.afterEach((to, from) => { // finish the progress bar this.$Progress.finish() })

} } `

RejownAhmed avatar Feb 19 '23 11:02 RejownAhmed