uni-app:实现根据列表index跳转到对应的页面

it2026-04-19  2

项目需要:实现当前页面中对应列表项的点击跳转到对应的页面,跳转的页面是一个swiper遍历的swiper-item;

解决办法如下: 当前页面: 跳转的页面: template里: script里面的:

注: encodeURIComponent(JSON.stringify())方法和JSON.parse(decodeURIComponent())方法可以省略,这是涉及转码的方法,这里我传入的index可以不需要!!

官方法参考官网 API 中”路由及页面跳转“中的uni.navigate To, 地址:官网uni.navigate To实现页面跳转方法

最新回复(0)