请选择 进入手机版 | 继续访问电脑版
帖子
帖子
用户
博客
课程
显示全部楼层
174
帖子
3
勋章
1067
Y币

[App引擎] avm ontouchstart ios无法获取data- 安卓可以

[复制链接]
发表于 2021-12-8 15:53:33
<view class={"item " + (this.data.clickEle == item.id ? "hover--class" : "hoverover--class")} data-sid={item.id} ontouchstart="ontouchstart" ontouchend="ontouchend">
      <text>151524</text>
</view>


e.currentTarget  安卓中有data-sid


{"id":"o41","type":"view","attributes":{"data-sid":"sc_5","class":"item hoverover--class","style":{}},"events":["touchstart","touchend"],"children":[{"id":"o42","type":"text","attributes":{"text":"151524","style":{}},"children":[{"id":"o43","type":"#text","attributes":{"style":{}}}]}]}




e.currentTarget  ios没有
{"id":"o33","type":"view","attributes":{"class":"item hoverover--class","style":{}},"events":["touchstart","touchend"],"children":[{"id":"o34","type":"text","attributes":{"text":"151524","style":{}},"children":[{"id":"o35","type":"#text","attributes":{"style":{}}}]}]}



174
帖子
3
勋章
1067
Y币
ontouchend 也是一样的
28
帖子
1
勋章
1万+
Y币
通过 e.currentTarget.dataset 来获取数据集中的数据。
85
帖子
6
勋章
5705
Y币
安卓是没有问题的,但是IOS里面没有这个dataset
技术咨询-Kenny · 2022-1-7 10:57通过 e.currentTarget.dataset 来获取数据集中的数据。
28
帖子
1
勋章
1万+
Y币
你直接取值用就行了,不要看打印的东西,或者直接打印 e.currentTarget.dataset。
Not Foundcl · 2022-1-7 14:07安卓是没有问题的,但是IOS里面没有这个dataset

您需要登录后才可以回帖 登录

本版积分规则