If you think the main picture looks good, give it a like and you will see such a beautiful scenery sooner or later!
The first way is getCurrentPages
- Get the current page stack. The first element in the array is the home page, and the last element is the current page.
- Do not try to modify the page stack, as this will cause routing and page status errors.
- Do not call getCurrentPages() during App.onLaunch, when the page has not yet been generated.
Code example
const pages = getCurrentPages(); // 当前页的数据,
const prevPage = pages[pages.length -