Three ways for mini program navigateBack to return with parameters (details)

Insert image description here
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 -

Guess you like

Origin blog.csdn.net/weixin_40639095/article/details/132824237