自定义的属性为啥获取不到啊,dataset里啥都没有?

发布于 6 年前作者 xiajun14765 次浏览最后编辑 6 年前来自 issues
  1. <view class="shop_row" wx:for="{{shop}}" data-index='{{index}}'  wx:key>


  2. {type: "tap", timeStamp: 5344, target: {…}, currentTarget: {…}, mark: {…}, …}

    1. changedTouches: [{…}]

    2. currentTarget:

      1. dataset: {}

      2. id: ""

      3. offsetLeft: 256

      4. offsetTop: 592

      5. __proto__: Object

    3. detail: {x: 328, y: 608}

    4. mark: {}

    5. target: {id: "", offsetLeft: 256, offsetTop: 592, dataset: {…}}

    6. timeStamp: 5344

    7. touches: [{…}]

    8. type: "tap"

5 回复
xiuyingqiu
xiuyingqiu1 楼6 年前

都牛

panjun
panjun2 楼6 年前

事件绑定在哪个节点上,就能获取到那个节点的dataset,前提是设置了data-xxx=“…”

junren
junren3 楼6 年前

你事件加在哪的?

longping
longping4 楼6 年前

你也没绑定事件,做个代码片段

chao71
chao715 楼4 年前

tap是绑在哪个节点上的?