<template>
<div @click="$emit('navigate')" class="scan" :style="'transform: translate('+ x +'px,' + y +'px);'" @touchstart="touchS"
@touchmove.stop.prevent="touchM" @touchend="touchE">
<uni-icons class="icon" type="scan" color="#fff" size="30"></uni-icons>
</div>
</template>
<script>
export default {
data() {
return {
isC: false,
start: {
left: 0,
top: 0
},
x: 0,
y: 0,
oldx: 0,
oldy: 0,
screenHeight: 667,
screenWidth: 375
}
},
mounted() {
uni.getSystemInfo({
success: (res) => {
this.screenHeight = res.screenHeight - 30;
this.screenWidth = res.screenWidth - 30;
}
});
},
methods: {
touchS(val) {
this.isMove = true
this.start.left
uni-app 控件拖拽
最新推荐文章于 2025-03-25 15:42:30 发布