9433cfb9创建于 2025年12月31日历史提交
<template>
  <list-view style="flex: 1;" :scroll-top="scrollTop">
    <list-item v-for="item in 50" :key="item" @longpress="longpress_item"
      style="border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: black;">
      <view style="width: 100%; height: 40px; background-color: antiquewhite;">
        <text @longpress="longpress_text"
          style="font-size: 10px; width: 100px; height: 100%; background-color: red;">{{ item }}</text>
      </view>
    </list-item>
  </list-view>
</template>

<script>
  export default {
    data() {
      return {
        longpressItem: false,
        longpressText: false,
        isStopPropagation: false,
        scrollTop: 0
      };
    },
    methods: {
      longpress_item(_e : UniTouchEvent) {
        console.log("longpress listItem")
        this.longpressItem = true
      },
      longpress_text(e : UniTouchEvent) {
        console.log("longpress text")
        this.longpressText = true
        if (this.isStopPropagation) {
          e.stopPropagation()
        }
      }
    },
  };
</script>

<style>

</style>