Router push in vue.js
You can access the router instance as $router in Vue instance. Then call
$this.$router.push
You can use router.push to navigate to different URLs. router.push method pushes a new entry to history so when the user clicks the back button on the browser they will be redirected to the previous URL. When you click <router-link> it's equivalent to router.push. The argument can be a string path or location descriptor object.
// literal string path router.push('home') // object router.push({ path: 'home' }) // named route router.push({ name: 'user', params: { userId: '123' } }) // with query, resulting in /register?plan=private router.push({ path: 'register', query: { plan: 'private' } })
If the path is already provided the params will not be considered. The same applies to router-link components also. In version 2.2.0 provide onComplete and onAbort as optional callbacks to router.push or router.replace as second and third arguments. In 3.1.0+ you don’t have to add 2nd and 3rd parameters.
sam smith
16 Apr 2023
I just want the whole world to know about this spell caster I met two weeks ago, I cannot say everything he has done for me my wife left me 3 years ago left with my kids I was going through online when I meant this wonderful man's testimony online I decided to give it a try and my wife is back to me now and we are happily married again cause is too much to put in writing all I can say is thank you very much am very happy Contact him today on oseremenspelltemple@gmail.com or whatsapp him on +2348136482342. www.facebook.com/Dr-odion-spell-temple-110513923938220