微信小程序开发之为页面绑定动态数组
微信小程序开发之为页面绑定动态数组如何绑定动态数组常见错误
如何绑定动态数组
首先在页面的js文件中建立一个数组
Page({
data:{
result: [{id: "001", name: "tom", major: "cs"}]
}
})
然后修改wxml中的代码:
<view class='list' bindtap= 'detail' wx:for="{{result}}" wx:key="index" >
<view>
<text>姓名
原创
2021-04-15 17:35:34 ·
972 阅读 ·
0 评论