router.goBack() several times in one jump


#1

Can anyone explain me a correct way for router.goBack() for several steps in one jump?

I have a history list of my path through the pages. When user tap some entry in this list, router should navigate to this page. I made a for loop and repeat router.goBack() several times. All works just fine, but may be there is a better way?

Thanks in advance!


#2

Why don’t you use router.goto("page") instead? You can go to the intended page wherever you are!