微信小程序自定义属性设置和获取

 <block wx:for='{{post_key}}' wx:key="key" wx:for-item='item'>
    <view catchtap='onPostTap' data-postid="{{item.postId}}">
      <template is='postItem' data='{{...item}}' />
    </view>
  </block>
  1. let postId=event.currentTarget.dataset.postid;
  2. console.log(postId);

  

posted @ 2020-07-06 14:49  Sea。  阅读(3357)  评论(0编辑  收藏  举报