uni-app nvue页面引入vue悬浮可拖拽组件,@touchstart事件获取不到clientY和clientX,HbuliderX使用的是最新版的3.2.9,请问是什么原因呢????
悬浮组件组件代码:
<template>
<view class="sa-hover-menu">
<!-- 开关按钮 -->
<view class="click-btn" @tap="show = !show" :style="{top: top+statusBarHeight + 'px' }" draggable="true"
@touchstart="touchstart" @touchend="touchend" @touchmove.stop.prevent="touchmove">
<image style="width: 140rpx;height: 50rpx;" v-if="show" src="/static/fasticon.png"></image>
<image style="opacity: 0.5;width: 80rpx;height: 50rpx;" v-if="!show" src="/static/fasticon_c.png">
</image>
</view>
<!-- 快捷导航 -->
<view class="major-box">
<view class="nav-box" :class="{show: show}" :style="{top: top+statusBarHeight+15 + 'px' }" draggable="true"
@touchstart="touchstart" @touchend="touchend" @touchmove.stop.prevent="touchmove">
<view class="nav-btn" v-for="(item, index) in btnList" :key="index" @tap="clickBtn(index)">
<view class="nav-icon">
<image style="width: 90rpx;height: 90rpx;" :src="item" error-icon="photo" mode="aspectFit">
</image>
</view>
</view>
<!-- 遮罩层 -->
<view class="mask" @tap="show = false" @touchmove.stop.prevent></view>
</view>
</view>
</view>
</template>
父页面为vue页面可以获取到:
"touches": [{
"pageX": 20.33333396911621,
"force": 1,
"identifier": 0,
"pageY": 184.33334350585938,
"clientY": 184.33334350585938,
"clientX": 20.33333396911621
父页面为nvue页面值返回这些参数:
"touches": [{
"screenY": 261.3333435058594,
"screenX": 20.33333396911621,
"pageX": 20.33333396911621,
"pageY": 9.333333015441895,
"identifier": 0
}],
编辑模式:
"nvueStyleCompiler" : "uni-app",
HbuliderX使用的是最新版的3.2.9,请问是什么原因呢????
2 个回复
DCloud_uni-ad_HDX
请提供一个简单的测试工程
h***@163.com
你好,解决了吗,求个思路