<template>
<view @touchmove.stop="touchmove" @touchend.stop="touchend" @longpress.stop="longpress">
<view @longpress="longpress2" class="padding">
<text>测试</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
};
},
methods: {
touchmove() {
},
touchend() {
},
longpress() {
},
longpress2() {
console.log('长按事件')
}
}
};
</script>
4***@qq.com (作者)
这个是个demo,原页面代码太多逻辑太复杂
2023-07-07 15:45
Diligent_UI
回复 Diligent_UI: 回复 4***@qq.com: 这是一个mixins?事件绑定在谁身上
2023-07-07 15:48
4***@qq.com (作者)
回复 Diligent_UI: 绑定了两个长按事件 外层那个是好着的,里面那个长按事件就变成点击事件了
2023-07-07 15:52
4***@qq.com (作者)
回复 Diligent_UI: 多个长按事件嵌套就会出现内层的长按事件变成点击事件的结果
2023-07-07 15:59