# 解决tabBar不能传参的问题 A页面跳转B,下列哪种方法可以在tabBar的页面上获取到参数id的值? ## 答案 A页面: uni.setStorageSync('id', 999); uni.switchTab({ url: '/pages/center/center' }); B页面: const id = uni.getStorageSync('id'); ## 选项 ### A A页面: uni.switchTab({ url: '/pages/center/center?id=999' }); B页面: onLoad(option){ var id = option.id } ### B A页面: uni.navigateTo({ url: '/pages/center/center?id=999' }); B页面: onLoad(option){ var id = option.id } ### C A页面: uni.redirectTo({ url: '/pages/center/center?id=999' }); B页面: onLoad(option){ var id = option.id }