<!-- index page -->
<template>
<view class="content">
<view class="logo" @tap.stop="onTap(item)" v-for="item in list" :key="item" @longtap.stop="onLongtap(item)">
<text class="title" :style="{color: cur === item ? 'red': 'black'}">{{ item }}</text>
</view>
</view>
</template>
<script setup lang="ts">
import { ref } from 'vue'
const title = ref('Hello')
const list = [1,2,3,4,5]
const cur = ref(-1)
const onTap = (v: number) => {
console.log('onTap', v);
cur.value = v
}
const onLongtap = (v: number) => {
console.log('onLongtap', v);
uni.navigateTo({
url: '/pages/home/index'
})
return false
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200rpx;
width: 100%;
text-align: center;
line-height: 200rpx;
margin-top: 10rpx;
margin-bottom: 10rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>
a***@163.com (作者)
确实是微信那边的问题,我已反馈到微信社区
2023-02-07 14:08