navigator是一个跳转组件,参数用?拼接在路径后面。如果想要获取这个参数值的话,到你跳转的页面onload函数里面,console.log(options)就可以拿到了
navigator中无法获取变量值- 当前 Bug 的表现(可附上截图) navigator中无法获取变量值,如图: [图片] - 预期表现 - 复现路径 - 提供一个最简复现 Demo WXML: [代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]'topic-title'[代码][代码]>[代码] [代码]<[代码][代码]text[代码][代码]>#话题讨论{{current_circle.circle_id}}</[代码][代码]text[代码][代码]>[代码] [代码]<[代码][代码]navigator[代码] [代码]data-id[代码][代码]=[代码][代码]"{{current_circle.circle_id}}"[代码] [代码]url[代码][代码]=[代码][代码]'/pages/topic/index/index?circle_id={{current_circle.circle_id}}'[代码] [代码]hover-class[代码][代码]=[代码][代码]"none"[代码][代码]>[代码] [代码]<[代码][代码]text[代码][代码]>加入讨论{{current_circle.circle_id}}</[代码][代码]text[代码][代码]>[代码] [代码]<[代码][代码]image[代码] [代码]src[代码][代码]=[代码][代码]'/resources/images/more@3x.png'[代码] [代码]mode[代码][代码]=[代码][代码]'aspectFill'[代码][代码]></[代码][代码]image[代码][代码]>[代码] [代码]</[代码][代码]navigator[代码][代码]>[代码] [代码]</[代码][代码]view[代码][代码]>[代码] JS: [代码]Page({[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]current_circle: {[代码]}[代码] [代码][代码]},[代码] [代码] [代码][代码]onLoad: [代码][代码]function[代码][代码](){[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码] [代码][代码]var[代码] [代码]current_circle = that.data.current_circle[代码][代码] [代码][代码]current_circle.circle_id = 27[代码] [代码] [代码][代码]that.setData({[代码][代码] [代码][代码]current_circle: current_circle[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码]})[代码]
2019-06-12