File tree 1 file changed +23
-4
lines changed
1 file changed +23
-4
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <div class =" md-ripple" :class =" { 'md-disabled': mdDisabled }" @touchstart.passive.stop =" startRipple" @mousedown.passive.stop =" startRipple" >
2
+ <div
3
+ class =" md-ripple"
4
+ :class =" rippleClasses"
5
+ @touchstart.passive.stop =" touchStartCheck"
6
+ @touchmove.passive.stop =" touchMoveCheck"
7
+ @mousedown.passive.stop =" startRipple" >
3
8
<slot />
4
9
5
10
<transition name =" md-ripple" appear @after-enter =" clearWave" v-if =" !mdDisabled" >
6
- <span class =" md-ripple-wave" :class =" rippleClass " :style =" waveStyles" v-if =" animating" ref =" rippleWave" />
11
+ <span class =" md-ripple-wave" :class =" waveClasses " :style =" waveStyles" v-if =" animating" ref =" rippleWave" />
7
12
</transition >
8
13
</div >
9
14
</template >
21
26
data : () => ({
22
27
eventType: null ,
23
28
waveStyles: null ,
24
- animating: false
29
+ animating: false ,
30
+ touchTimeout: null
25
31
}),
26
32
computed: {
27
- rippleClass () {
33
+ rippleClasses () {
34
+ return {
35
+ ' md-disabled' : this .mdDisabled
36
+ }
37
+ },
38
+ waveClasses () {
28
39
return {
29
40
' md-centered' : this .mdCentered
30
41
}
41
52
}
42
53
},
43
54
methods: {
55
+ touchMoveCheck () {
56
+ window .clearTimeout (this .touchTimeout )
57
+ },
58
+ touchStartCheck ($event ) {
59
+ this .touchTimeout = window .setTimeout (() => {
60
+ this .startRipple ($event)
61
+ }, 100 )
62
+ },
44
63
async startRipple ($event ) {
45
64
const { eventType , mdDisabled , mdCentered } = this
46
65
You can’t perform that action at this time.
0 commit comments