在微信小程序 onShow() 事件中接收上个页面传递的数据
获取页面 url 传递过来的参数。url中传递的参数只能在 onLoad() 事件中接收,在 onShow() 事件中不能接收 。在特定的情况下有必须在 onShow() 事件中接收,这时候就要用到 getCurrentPages() 。onShow() { let pages = getCurrentPages(); // 获取小程序的页面栈 let currentPage = pages[pages.length-1]; // 数组中索引最大的页面--当前页面 consol
复制链接