File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<el-cascader
3
+ @wheel =" wheel"
4
+ @keydown =" isKeyDown = true"
5
+ @keyup =" isKeyDown = false"
3
6
:teleported =" false"
4
7
:options =" options"
5
8
@visible-change =" visibleChange"
8
11
separator =" > "
9
12
>
10
13
<template #default =" { node , data } " >
11
- <span class =" flex align-center" >
14
+ <span
15
+ class =" flex align-center"
16
+ @wheel =" wheel"
17
+ @keydown =" isKeyDown = true"
18
+ @keyup =" isKeyDown = false"
19
+ >
12
20
<component :is =" iconComponent(`${data.type}-icon`)" class =" mr-8" :size =" 18" />{{
13
21
data.label
14
22
}}</span
@@ -34,6 +42,15 @@ const data = computed({
34
42
}
35
43
})
36
44
const options = ref <Array <any >>([])
45
+ const isKeyDown = ref (false )
46
+ const wheel = (e : any ) => {
47
+ if (isKeyDown .value ) {
48
+ e .preventDefault ()
49
+ } else {
50
+ e .stopPropagation ()
51
+ return true
52
+ }
53
+ }
37
54
38
55
function visibleChange(bool : boolean ) {
39
56
if (bool ) {
You can’t perform that action at this time.
0 commit comments