<view bindtap="goNewDetails" class="info-item" data-newsUrl="{{item.newsUrl}}" id="{{item.newsID}}" >
</view>
后台
var url=e.currentTarget.dataset.newsurl;
自定义的属性都会转为小写,js取时要注意!
<view bindtap="goNewDetails" class="info-item" data-newsUrl="{{item.newsUrl}}" id="{{item.newsID}}" >
</view>
后台
var url=e.currentTarget.dataset.newsurl;
自定义的属性都会转为小写,js取时要注意!
转载于:https://my.oschina.net/NeverMoreMoon/blog/888526