// 获取当前页面栈数组 const pages = getCurrentPages(); // 获取当前页面(数组中的最后一个) const currentPage = pages[pages.length - 1]; // 获取当前页面路径 const currentPath = currentPage.route; // 全部路径 const fullPath = pages[pages.length - 1].$page.fullPath; console.log(currentPath);