Skip to content
This repository has been archived by the owner on Nov 30, 2020. It is now read-only.

Commit

Permalink
fix(button): fix bug similar to #377 (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
tychenjiajun committed Aug 12, 2019
1 parent 13895fc commit 24d6a26
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions components/button/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ export default {
},
watch: {
classes () {
this.reinitRipple()
this.reInstantiateRipple()
},
ripple () {
this.reinitRipple()
this.reInstantiateRipple()
}
},
mounted () {
Expand Down Expand Up @@ -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
}
}
}
Expand Down

0 comments on commit 24d6a26

Please sign in to comment.