🏆uni-app獲取上層路由的方法
var pages = getCurrentPages();//獲取頁面 var beforePage = pages[pages.length - 2];//上個頁面 調上個頁面方法 // #ifdef H5 beforePage.submitAct() // #endif 但是,在uni-app中是適配多端的,beforePage.submitAct()只在h5中有效,在app端和微信小程序端都會報錯 not a function 在h5和app中實現當前頁調上個頁面方法 // #ifndef H5 beforePage.$vm.submitAct() // #endif