问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图
index.wxml:
<navigator url="../shoplist/shoplist?usetype={{usingtype}},searchK={{searchK}}">Startsearch</navigator>
<input class="inp" type="text" bindinput="getinputvalue" placeholder="输入商品的名称"></input>
index.js
data:{ searchK:'',},
getinputvalue:function(e){
this.setData({
searchK:e.detail.value
})
},
page1.wxml:
<scroll-view class="box" scroll-y="true">
<navigator class="bbar" wx:for="{{result}}" wx:key="id" url="../result/result?id={{result.id}}" >
<text>{{result.name}}</text>
</navigator>
</scroll-view>
page1.js
data: {
result:[{"name":"kks",src:"",id:"1",imageMap:"",rank:""},
{"name":"kks",src:"",id:"1",imageMap:"",rank:""},
{"name":"kks",src:"",id:"1",imageMap:"",rank:""},
{"name":"kks",src:"",id:"1",imageMap:"",rank:""},
],
运行结果及报错内容
index页面,在输入框中输入之后传参的对应是空值。
page1页面,用for循环能遍历出四个对象,但没法显示name属性,“name:有没有加引号都不行