使用uni-app开发微信小程序是时报错routeDone with a webviewId 80 that is not the current page(env: Windows,mp,1.06.2312061; lib: 3.2.3)
时间: 2024-06-14 07:07:37 浏览: 134
根据提供的引用内容,报错"routeDone with a webviewId 80 that is not the current page"可能是由于uni-app开发的微信小程序中存在页面路由错误导致的。这个错误通常发生在页面跳转时,当前页面的webviewId与目标页面的webviewId不匹配。
解决这个问题的方法是检查页面路由配置和页面跳转代码,确保它们正确匹配。可以按照以下步骤进行排查和修复:
1. 检查pages.json文件中的路由配置,确保每个页面的路径和webviewId正确配置。确保目标页面的webviewId与报错信息中的webviewId一致。
2. 检查页面跳转代码,确保使用正确的页面路径和webviewId进行跳转。可以使用uni.navigateTo、uni.redirectTo或uni.reLaunch等方法进行页面跳转。
3. 如果以上步骤都没有解决问题,可以尝试降低微信开发者工具的版本,或者更新uni-app的版本,以确保兼容性。
以下是一个示例代码,演示如何使用uni-app开发微信小程序时避免报错"routeDone with a webviewId that is not the current page":
```javascript
// pages.json
{
"pages": [
{
"path": "pages/home/home",
"webviewId": 80
},
{
"path": "pages/detail/detail",
"webviewId": 81
}
]
}
// 跳转到目标页面
uni.navigateTo({
url: '/pages/detail/detail?webviewId=81'
})
```
阅读全文
相关推荐

















