From 24d6a2688ab4a50b908515d0596ad6dbcf9d4236 Mon Sep 17 00:00:00 2001 From: Jiajun Chen Date: Mon, 12 Aug 2019 09:41:26 +0800 Subject: [PATCH] fix(button): fix bug similar to #377 (#382) --- components/button/Button.vue | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/components/button/Button.vue b/components/button/Button.vue index 53304801c..3261da1f6 100644 --- a/components/button/Button.vue +++ b/components/button/Button.vue @@ -75,10 +75,10 @@ export default { }, watch: { classes () { - this.reinitRipple() + this.reInstantiateRipple() }, ripple () { - this.reinitRipple() + this.reInstantiateRipple() } }, mounted () { @@ -111,10 +111,17 @@ export default { }) } }, - reinitRipple () { - if (this.mdcRipple) { - this.mdcRipple.destroy() - if (this.ripple) this.mdcRipple = MDCRipple.attachTo(this.$el) + reInstantiateRipple () { + if (this.ripple) { + if (this.mdcRipple) { + this.mdcRipple.destroy() + } + MDCRipple.attachTo(this.$el) + } else { + if (this.mdcRipple) { + this.mdcRipple.destroy() + } + this.mdcRipple = undefined } } }