当前位置:网站首页>Read the wheelevent in one article
Read the wheelevent in one article
2022-07-27 15:36:00 【polite】
https://segmentfault.com/a/1190000017390159?utm_source=tag-newest
<template>
<el-scrollbar
ref="scrollContainer"
:vertical="false"
class="scroll-container"
@wheel.native.prevent="handleScroll"
>
<slot/>
</el-scrollbar>
</template>
<script>
export default {
name: "ScrollPane",
data() {
return {
left: 0
};
},
methods: {
handleScroll(e) {
// wheelDelta: Get the scroll wheel rolling direction , Up 120, Down -120, But constant , Independent of roller speed
// deltaY: Vertical scrolling range , Positive values scroll down . The default value for the number of vertical lines of the computer mouse wheel is 3
// wheelDelta Only some browsers support ,deltaY Almost all browsers support
const eventDelta = e.wheelDelta || -e.deltaY * 40;
const $scrollWrapper = this.$refs.scrollContainer.$refs.wrap;
// 0 To scrollLeft Hide part for scrolling area
$scrollWrapper.scrollLeft = $scrollWrapper.scrollLeft + eventDelta / 4;
}
}
};
</script>
边栏推荐
- Spark Filter算子在Parquet文件上的下推
- Pytorch replaces some components in numpy. / / please indicate the source of the reprint
- Network equipment hard core technology insider router 20 dpdk (V)
- Leetcode 74. search two-dimensional matrix bisection /medium
- 【剑指offer】面试题54:二叉搜索树的第k大节点
- HaoChen CAD building 2022 software installation package download and installation tutorial
- After configuring corswebfilter in grain mall, an error is reported: resource sharing error:multiplealloworiginvalues
- 初探JuiceFS
- Simple mathematical knowledge related to 3D
- Network equipment hard core technology insider router Chapter 10 Cisco asr9900 disassembly (III)
猜你喜欢

STM32 can communication filter setting problem

学习Parquet文件格式

Tools - common methods of markdown editor

Basic usage of kotlin

Unity性能优化------渲染优化(GPU)之LOD(Level of detail)

Spark 3.0 Adaptive Execution 代码实现及数据倾斜优化

Leetcode 74. search two-dimensional matrix bisection /medium

Adaptation verification new occupation is coming! Huayun data participated in the preparation of the national vocational skill standard for information system adaptation verifiers

Summer Challenge harmonyos realizes a hand-painted board

3.3-5v conversion
随机推荐
Leetcode 240. search two-dimensional matrix II medium
西瓜书《机器学习》阅读笔记之第一章绪论
flutter —— 布局原理与约束
《剑指Offer》数组中的逆序对
《剑指Offer》 合并两个排序的链表
Unity performance optimization ----- drawcall
Unity performance optimization ----- occlusion culling of rendering optimization (GPU)
Complexity analysis
使用双星号代替Math.pow()
Unity's simplest object pool implementation
$router.back(-1)
Spark动态资源分配的资源释放过程及BlockManager清理过程
C language: factorial recursive implementation of numbers
Network equipment hard core technology insider router Chapter 10 Cisco asr9900 disassembly (III)
reflex
How to edit a framework resource file separately
《吐血整理》C#一些常用的帮助类
适配验证新职业来了!华云数据参与国家《信息系统适配验证师国家职业技能标准》编制
How to package AssetBundle
Network equipment hard core technology insider router Chapter 21 reconfigurable router