我在一个页面放置三个picker,选择第一个picker的时候,后边的bindchange事件也会跟着触发,见下图:
< view class = "head" >
< view class = "picker" >
< picker
bindchange = "stylesChange"
value = "{{stylesIndex}}"
range = "{{styles}}" >
< view class = "weui-cell weui-cell_access" >
< view class = "weui-cell__bd" >商品样式view >
< view class = "weui-cell__ft weui-cell__ft_in-access" >
{{styles[stylesIndex]}}
view >
view >
picker >
view >
< view class = "picker" >
< picker
bindchange = "countChange"
value = "{{countIndex}}"
range = "{{count}}" >
< view class = "weui-cell weui-cell_access" >
< view class = "weui-cell__bd" >显示个数view >
< view class = "weui-cell__ft weui-cell__ft_in-access" >
{{count[countIndex]}}
view >
view >
picker >
view >
< view class = "picker" >
< picker
bindchange = "categoryChange"
value = "{{categoryIndex}}"
range = "{{category}}" >
< view class = "weui-cell weui-cell_access" >
< view class = "weui-cell__bd" >商品列表view >
< view class = "weui-cell__ft weui-cell__ft_in-access" >
{{category[categoryIndex]}}
view >
view >
picker >
view >
view >
|
Page({
data: {
styles: [ '小图' , '大图' , '详细列表' ],
stylesIndex: 0,
count: [4,6,8,16,20],
countIndex: 0,
category: [ '推荐商品' , '最新商品' , '...' ],
categoryIndex: 0,
productList: 4
},
stylesChange(e){
this .setData({
stylesIndex: e.detail.value
})
},
countChange(e){
this .setData({
productList: + this .data.count[e.detail.value],
countIndex: e.detail.value
})
},
categoryChange(e){
this .setData({
categoryIndex: e.detail.value
})
},
onLoad: function (options) {
},
onReady: function () {
},
onShow: function () {
},
onHide: function () {
},
onUnload: function () {
},
onPullDownRefresh: function () {
},
onReachBottom: function () {
},
onShareAppMessage: function () {
}
})
|
真机上有出现同样问题吗?
真机上试了一下,没有出现问题。