Answer the question
In order to leave comments, you need to log in
How to use onComplete?
https://router.vuejs.org/ru/guide/essentials/navig...
From the documentation:
Since version 2.2.0+, you can optionally specify the onComplete and onAbort callbacks in router.push or router.replace as the 2nd and 3rd arguments. These callbacks will be called when navigation is either successfully completed (after all asynchronous hooks have completed) or aborted (by going to the same route or another route before the current navigation is completed), respectively.
Answer the question
In order to leave comments, you need to log in
Is that how it's written? Announce in
onComplete will be executed after successful completion of router.push, onAbort otherwise.
router.push('path', () => { console.log('onSuccess') }, () => { console.log('onAbort') })
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question