<view bindtap="getDataAttr" data-postId="{{postId}}" data-id="id" class="div"> </view>
getDataAttr:function(e){ console.log(e.currentTarget.dataset.id) console.log(e.currentTarget.dataset.postId) }