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

Commit b921ede

Browse files
committed
fix(list): Set ripple on class changes
BREAKING CHANGES: Removed interactive prop, ripple effect is now default.
1 parent 34fcfe3 commit b921ede

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

components/list/ListItem.vue

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
<template>
22
<li
3-
class="mdc-list-item"
43
:class="classes"
4+
class="mdc-list-item"
55
v-on="$listeners">
66
<slot
7-
name="graphic"
8-
v-if="$slots['graphic']"/>
7+
v-if="$slots['graphic']"
8+
name="graphic"/>
99
<slot/>
1010
<span
11-
class="mdc-list-item__text"
12-
v-if="$slots['text']">
11+
v-if="$slots['text']"
12+
class="mdc-list-item__text">
1313
<slot name="text"/>
1414
<div
15-
class="mdc-list-mdc-list-item__secondary-text"
16-
v-if="$slots['secondaryText']">
15+
v-if="$slots['secondaryText']"
16+
class="mdc-list-mdc-list-item__secondary-text">
1717
<slot name="secondaryText"/>
1818
</div>
1919
</span>
2020
<slot
21-
name="meta"
22-
v-if="$slots['meta']"/>
21+
v-if="$slots['meta']"
22+
name="meta"/>
2323
</li>
2424
</template>
2525

@@ -31,10 +31,6 @@ import themeClassMixin from '../base/themeClassMixin.js'
3131
export default {
3232
mixins: [themeClassMixin],
3333
props: {
34-
interactive: {
35-
type: Boolean,
36-
default: false
37-
},
3834
activated: {
3935
type: Boolean,
4036
default: false
@@ -58,23 +54,28 @@ export default {
5854
}
5955
}
6056
},
57+
watch: {
58+
classes () {
59+
this.mdcRipple.destroy()
60+
this.mdcRipple = MDCRipple.attachTo(this.$el)
61+
}
62+
},
6163
mounted () {
6264
this.updateSlots()
63-
this.slotObserver = new MutationObserver( () => this.updateSlots())
65+
this.slotObserver = new MutationObserver(() => this.updateSlots())
6466
this.slotObserver.observe(this.$el, {
6567
childList: true,
6668
subtree: true
6769
})
68-
69-
if (this.interactive) { this.mdcRipple = MDCRipple.attachTo(this.$el) }
70+
this.mdcRipple = MDCRipple.attachTo(this.$el)
7071
},
7172
beforeDestroy () {
7273
this.slotObserver.disconnect()
73-
if (typeof this.mdcRipple !== 'undefined') {
74-
this.mdcRipple.destroy()
74+
if (typeof this.mdcRipple !== 'undefined') {
75+
this.mdcRipple.destroy()
7576
}
7677
},
77-
methods: {
78+
methods: {
7879
updateSlots () {
7980
if (this.$slots.graphic) {
8081
this.$slots.graphic.map(n => {

components/list/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272

7373
| Prop | Type | Default | Description |
7474
|------|------|---------|-------------|
75-
| interactive | Boolean | false | ripple effect |
7675
| activated | Boolean | false | activated item |
7776
| selected | Boolean | false | selected item |
7877

0 commit comments

Comments
 (0)