You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.1 KiB
56 lines
1.1 KiB
3 weeks ago
|
<template>
|
||
|
<view class="wanl-live-bulletin">
|
||
|
<view @touchstart="onTouchStart" @touchmove="onTouchMove" class="sdfsdf" :style="{left: touch.left, top: touch.top}">
|
||
|
<text style="color: aliceblue;">{{touch}}</text>
|
||
|
</view>
|
||
|
</view>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
name: "wanlLiveBulletin",
|
||
|
props: {
|
||
|
text: {
|
||
|
type: String,
|
||
|
default: ''
|
||
|
}
|
||
|
},
|
||
|
data() {
|
||
|
return {
|
||
|
touch: {
|
||
|
left: 0,
|
||
|
top: 0,
|
||
|
width: 0,
|
||
|
height: 0
|
||
|
}
|
||
|
};
|
||
|
},
|
||
|
methods: {
|
||
|
onTouchStart(e) {
|
||
|
this.touch.left = e.touches[0].pageX;
|
||
|
this.touch.top = e.touches[0].pageY;
|
||
|
// 双击
|
||
|
if(e.touches.length == 2){
|
||
|
this.touch.width = e.touches[0].pageX - e.touches[1].pageX;
|
||
|
this.touch.height = e.touches[0].pageY - e.touches[1].pageY;
|
||
|
}
|
||
|
},
|
||
|
onTouchMove(e) {
|
||
|
this.touch.left = e.touches[0].pageX;
|
||
|
this.touch.top = e.touches[0].pageY;
|
||
|
// 双击
|
||
|
if(e.touches.length == 2){
|
||
|
this.touch.width = e.touches[0].pageX - e.touches[1].pageX;
|
||
|
this.touch.height = e.touches[0].pageY - e.touches[1].pageY;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style>
|
||
|
.wanl-live-bulletin {
|
||
|
}
|
||
|
</style>
|