Skip to content

Commit bbf206f

Browse files
authored
fix(directives): [mousewheel] fix type error (element-plus#8880)
1 parent 7bb6b6d commit bbf206f

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"lodash-es": "^4.17.21",
6767
"lodash-unified": "^1.0.2",
6868
"memoize-one": "^6.0.0",
69-
"normalize-wheel-es": "^1.1.2"
69+
"normalize-wheel-es": "^1.2.0"
7070
},
7171
"devDependencies": {
7272
"@commitlint/cli": "^17.0.3",

packages/directives/mousewheel/index.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
// @ts-nocheck
21
import normalizeWheel from 'normalize-wheel-es'
2+
33
import type { DirectiveBinding, ObjectDirective } from 'vue'
4+
import type { NormalizedWheelEvent } from 'normalize-wheel-es'
45

5-
const mousewheel = function (element, callback) {
6+
const mousewheel = function (
7+
element: HTMLElement,
8+
callback: (e: WheelEvent, normalized: NormalizedWheelEvent) => void
9+
) {
610
if (element && element.addEventListener) {
7-
const fn = function (this: any, event) {
11+
const fn = function (this: HTMLElement, event: WheelEvent) {
812
const normalized = normalizeWheel(event)
913
callback && Reflect.apply(callback, this, [event, normalized])
1014
}

packages/element-plus/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"lodash-es": "^4.17.21",
6666
"lodash-unified": "^1.0.2",
6767
"memoize-one": "^6.0.0",
68-
"normalize-wheel-es": "^1.1.2"
68+
"normalize-wheel-es": "^1.2.0"
6969
},
7070
"devDependencies": {
7171
"@types/node": "*",

pnpm-lock.yaml

Lines changed: 7 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)