<view class="local" id="{{itemName.id}}" data="{{itemName.name}}" class="list" bindtap=‘fastSearch‘ wx:for="{{getSearch}}" wx:for-index="" wx:for-item="itemName" wx:key=""> <view class="medicineName" wx:if="{{itemName.name!= ‘‘}}"> {{itemName.name}} </view> <view class="medicineFactory" wx:if="{{itemName.factory!=‘‘}}"> {{itemName.factory}} </view> </view>
[{"name":"方略喉舒宁片0.27g*18s*2板A002","id":26962,"factory":"广西方略药业集团有限公司"}]itemName循环的是数组中的元素,本质也是按下标,所以可以itemName.id取数组中的对象
用对象数组O(∩_∩)O哈哈~
时间: 2024-10-06 00:12:38