mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-18 12:34:25 +08:00
fix(button): remove rippling class after rippling
This commit is contained in:
parent
ef2bc776a4
commit
d6691db9ee
@ -169,7 +169,8 @@ export default {
|
||||
return {
|
||||
style: {},
|
||||
enterPressed: false,
|
||||
rippling: false
|
||||
rippling: false,
|
||||
rippleTimer: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -180,14 +181,23 @@ export default {
|
||||
return this.iconPosition === 'right'
|
||||
}
|
||||
},
|
||||
beforeDestroy () {
|
||||
window.clearTimeout(this.rippleTimer)
|
||||
},
|
||||
methods: {
|
||||
handleClick (e) {
|
||||
if (!this.disabled) {
|
||||
this.$emit('click', e)
|
||||
window.clearTimeout(this.rippleTimer)
|
||||
this.rippleTimer = null
|
||||
this.rippling = false
|
||||
this.$nextTick().then(() => {
|
||||
this.$el.getBoundingClientRect()
|
||||
this.rippling = true
|
||||
this.rippleTimer = window.setTimeout(() => {
|
||||
this.rippling = false
|
||||
this.rippleTimer = null
|
||||
}, 600)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user