同一个leancloud数据,如果我的小程序wxml中用的是默认的组件,我在拉取到数据的时候,是可以直接在wxml中点出来的,查找了本社区的帖子,发现是微信在传到视图渲染层的时候自动做了toJSON(),但是如果用自己定义的微信小程序组件,就无法直接点出属性,必须通过.attributes.XXX才能获取,看上去是在自定义组件中没有经过toJSON()。
请问我理解的对吗? 这个问题搞了我好久。。。。。
<view wx:for='{{softoutFitArray}}' wx:if='{{softoutFitArray.length > 0}}'>
<text class='name'>{{item.name}}</text>
<text>{{item.number}}</text>
<text>{{item.price}}</text>
</view>
<product-in-order wx:for='{{softoutFitArray}}' product-name='{{item.attributes.name}}' product-material='{{item.attributes.material}}' product-price='item.attributes.price'></product-in-order>