Skip to content
This repository has been archived by the owner on Jun 10, 2023. It is now read-only.

Commit

Permalink
πŸ› Ripple: apply ripple on component update
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed May 15, 2017
1 parent d6d448a commit 5834212
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/ripple.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ export default {
el.mdcRipple_.init()
},

inserted (el, binding, { componentInstance }) {
// TODO add test case
// I have been unable to reproduce the bug outside
// of vue-mdc docs, so it may have to deal with SSR
if (componentInstance) {
componentInstance.$on('hook:updated', () => {
el.mdcRipple_.destroy()
binding.def.bind(el, binding)
})
}
},

componentUpdated (el, binding, vnode, oldVnode) {
// Always recreate for functional components
if (vnode.functionalContext) {
Expand Down

0 comments on commit 5834212

Please sign in to comment.