// 获取页面URL参数 export function getLocationParams(name) { //获取页面栈 const pages = getCurrentPages(); //获取路由参数 const curPage = pages[pages.length - 1]; return name ? curPage.options[name] : curPage.options; }
//获取路由携带的id参数 let id = getLocationParams('id');
标签:id,获取,参数,pages,路由,页面 From: https://www.cnblogs.com/magicg/p/16932679.html