老益
老益
  • 发布:2021-10-21 15:15
  • 更新:2022-11-23 09:47
  • 阅读:810

app nvue页面引入vue悬浮可拖拽组件,@touchstart事件获取不到clientY和clientX

分类:nvue

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,请问是什么原因呢????
2021-10-21 15:15 负责人:DCloud_uniAD_HDX 分享
已邀请:
DCloud_uniAD_HDX

DCloud_uniAD_HDX

请提供一个简单的测试工程

h***@163.com

h***@163.com

你好,解决了吗,求个思路

要回复问题请先登录注册