-
<template>
-
<scroll-view :scroll-y="isScroll" @scroll="scroll" style="height: 800rpx;">
-
<view style="height: 400rpx;background-color: red;" @touchstart.stop.prevent="touchstart"
-
@touchmove.stop.prevent="touchmove" @touchend.stop.prevent="touchend">
-
</view>
-
<button @click="scrollT">123123</button>
-
<view style="height: 400rpx;background-color: yellow;" />
-
<view style="height: 400rpx;background-color: floralwhite;" />
-
<view style="height: 400rpx;background-color: lawngreen;" />
-
</scroll-view>
-</template>
-<script>
- export default {
- data() {
- return {
- isScroll: true
- }
- },
- watch: {
- isScroll(newData) {
- console.log(newData);
- }
- },
- methods: {
- scrollT() {
- this.isScroll = false
- },
- touchstart(e) {
- this.isScroll = true
- },
- touchmove(e) {},
- touchend(e) {
- this.isScroll = false
- },
- }
- }
-</script>