1、代码:
view = html中的div
text = html中的span
data:{} 相当于vue的data数据
模板语法:wx:if='{{true}}',值是true才会显示
绑定属性:data- ,如:data-aid='{{aid}}',
列表渲染:wx:for='{{list}}' 对应的value:{{index}},对应的labe:{{item}},
列表渲染:wx:for='{{list}}' 手动设置对应的item wx:for-item='item1',手动设置对应的index wx:for-index='index1'
<view> <view wx:for='{{item}}' wx:for-item='car' wx:for-index='ii'> 类别:{{car.car}}---序号:{{ii}} <view wx:for='{{car.car2}}' wx:for-item='car2' wx:for-index='ii2'> 车型:{{car2.name}},油耗:{{car2.oil}}---序号:{{ii2}} <view wx:for='{{car2.bb}}' wx:for-item='bb1' wx:for-index='ii3'> 车主:{{bb1.name}},年龄:{{bb1.age}}---序号:{{ii3}} </view> </view> </view> </view>