wx.onAppRoute((res) => {
const currentPath = `/${res.path}`;
}${props.TabListPr}`);
const matchedItem = RouterList.value.find(item => item.url === currentPath);
if (matchedItem) {
console.log(`找到匹配${activeIDS.value }路由:${currentPath}`);
console.log(`匹配项信息:`, matchedItem);
} else {
console.log(`未找到匹${activeIDS.value }配路由:${currentPath}`);
}
});
微信小程序监听路由 及匹配当前路由
最新推荐文章于 2024-05-29 14:13:00 发布
文章讲述了在微信小程序中如何使用`wx.onAppRoute`监听路由变化,并通过`RouterList`查找与当前路径匹配的项目,输出匹配或未匹配的信息。
摘要由CSDN通过智能技术生成