1
1
<template >
2
2
<li
3
- class =" mdc-list-item"
4
3
:class =" classes"
4
+ class =" mdc-list-item"
5
5
v-on =" $listeners" >
6
6
<slot
7
- name = " graphic"
8
- v-if = " $slots[' graphic'] " />
7
+ v-if = " $slots[' graphic'] "
8
+ name = " graphic" />
9
9
<slot />
10
10
<span
11
- class = " mdc-list-item__text "
12
- v-if = " $slots['text'] " >
11
+ v-if = " $slots['text'] "
12
+ class = " mdc-list-item__text " >
13
13
<slot name =" text" />
14
14
<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 " >
17
17
<slot name =" secondaryText" />
18
18
</div >
19
19
</span >
20
20
<slot
21
- name = " meta"
22
- v-if = " $slots[' meta'] " />
21
+ v-if = " $slots[' meta'] "
22
+ name = " meta" />
23
23
</li >
24
24
</template >
25
25
@@ -31,10 +31,6 @@ import themeClassMixin from '../base/themeClassMixin.js'
31
31
export default {
32
32
mixins: [themeClassMixin],
33
33
props: {
34
- interactive: {
35
- type: Boolean ,
36
- default: false
37
- },
38
34
activated: {
39
35
type: Boolean ,
40
36
default: false
@@ -58,23 +54,28 @@ export default {
58
54
}
59
55
}
60
56
},
57
+ watch: {
58
+ classes () {
59
+ this .mdcRipple .destroy ()
60
+ this .mdcRipple = MDCRipple .attachTo (this .$el )
61
+ }
62
+ },
61
63
mounted () {
62
64
this .updateSlots ()
63
- this .slotObserver = new MutationObserver ( () => this .updateSlots ())
65
+ this .slotObserver = new MutationObserver (() => this .updateSlots ())
64
66
this .slotObserver .observe (this .$el , {
65
67
childList: true ,
66
68
subtree: true
67
69
})
68
-
69
- if (this .interactive ) { this .mdcRipple = MDCRipple .attachTo (this .$el ) }
70
+ this .mdcRipple = MDCRipple .attachTo (this .$el )
70
71
},
71
72
beforeDestroy () {
72
73
this .slotObserver .disconnect ()
73
- if (typeof this .mdcRipple !== ' undefined' ) {
74
- this .mdcRipple .destroy ()
74
+ if (typeof this .mdcRipple !== ' undefined' ) {
75
+ this .mdcRipple .destroy ()
75
76
}
76
77
},
77
- methods: {
78
+ methods: {
78
79
updateSlots () {
79
80
if (this .$slots .graphic ) {
80
81
this .$slots .graphic .map (n => {
0 commit comments