收藏
回答

在自定义组件中使用wx:for和wx:if嵌套 出现wx:if异常问题?

Components代码:

A-trueisTodayBk-{{item.isTodayBk}}B-falseisTodayBk-{{item.isTodayBk}}


JS :
 properties: {
    goodList: {
      type: Array,
      value: []
    }
  }

   外部调用:

外部JS

goodList数值:
[{
	"beginTime": 1583837894000,
	"buyType": "1",
	"comment": "的",
	"id": "ab5086b67d7927f3cdfecef48f2ee592",
	"imgUrl11": "data/img/product/96z5fgn82bayoqkd.jpg",
	"imgUrl12": "data/img/product/aciyuieivu7v8dzy.jpg",
	"isNetBk": "0",
	"isTodayBk": "1",
	"marketPrice": 31.00,
	"name": "曲奇1",
	"price": 2.00
}, {
	"beginTime": 1583826956000,
	"buyType": "1",
	"comment": "21223123",
	"id": "bcc335946e60caebf5bee6c7bac8cdeb",
	"imgUrl11": "data/img/product/trp86jkcz6n33dt3.jpg",
	"imgUrl12": "data/img/product/coyvecm1r40ugnrw.jpg",
	"isNetBk": "1",
	"isTodayBk": "1",
	"marketPrice": 1.00,
	"name": "递四方速递",
	"price": 1.00
}, {
	"beginTime": 1583825060000,
	"buyType": "1",
	"comment": "1",
	"id": "194007ba670a6b8d6fc8040d86667cf5",
	"imgUrl11": "data/img/product/t3wlha7yc4r0l29s.jpg",
	"imgUrl12": "null",
	"isNetBk": "1",
	"isTodayBk": "0",
	"marketPrice": 1.00,
	"name": "1",
	"price": 0.00
}, {
	"beginTime": 1583837507000,
	"buyType": "1",
	"comment": "谬",
	"id": "11048ec84dcd0bfcaf377c8fffb9954e",
	"imgUrl11": "data/img/product/kx327vl944nxhfui.jpg",
	"imgUrl12": "data/img/product/mxlrziojo2n8ecir.jpg",
	"isNetBk": "1",
	"isTodayBk": "0",
	"marketPrice": 442.00,
	"name": "牛奶",
	"price": 99.00
}]

运行结果:

结果是错乱的 全部都执行了

最后一次编辑于  03-10
回答关注问题邀请回答
收藏

2 个回答

登录 后发表内容
问题标签