P
P
pegas2018-12-23 00:02:04
Vue.js
pegas, 2018-12-23 00:02:04

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.

What is onComplete? where to write it? where to declare?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Sedyshev, 2018-12-23
@ musikant777

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 question

Ask a Question

731 491 924 answers to any question