+26
-2
lines changedFilter options
+26
-2
lines changed Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
2
2
import MdInteractionEvents from 'core/utils/MdInteractionEvents'
3
3
import MdRouterLinkProps from 'core/utils/MdRouterLinkProps'
4
4
import MdListItemDefault from './MdListItemDefault'
5
+
import MdListItemFakeButton from './MdListItemFakeButton'
5
6
import MdListItemButton from './MdListItemButton'
6
7
import MdListItemLink from './MdListItemLink'
7
8
import MdListItemRouter from './MdListItemRouter'
@@ -22,6 +23,10 @@
22
23
}
23
24
}
24
25
26
+
function hasChildrenButtons (childrens) {
27
+
return childrens.default.some(children => children.componentOptions && children.componentOptions.tag === 'md-button')
28
+
}
29
+
25
30
function shouldRenderButtonWithListener (listeners) {
26
31
let listenerNames = Object.keys(listeners)
27
32
let shouldRender = false
@@ -39,7 +44,7 @@
39
44
return parent && parent.$router && props.to
40
45
}
41
46
42
-
function createListComponent (props, parent, listeners) {
47
+
function createListComponent (props, parent, listeners, children) {
43
48
if (hasExpansion(props)) {
44
49
return MdListItemExpand
45
50
}
@@ -62,6 +67,9 @@
62
67
}
63
68
64
69
if (shouldRenderButtonWithListener(listeners)) {
70
+
if (hasChildrenButtons(children)) {
71
+
return MdListItemFakeButton
72
+
}
65
73
return MdListItemButton
66
74
}
67
75
@@ -76,7 +84,7 @@
76
84
},
77
85
render (createElement, { parent, props, listeners, data, slots }) {
78
86
let children = slots()
79
-
let listComponent = createListComponent(props, parent, listeners)
87
+
let listComponent = createListComponent(props, parent, listeners, children)
80
88
let staticClass = 'md-list-item'
81
89
82
90
if (data.staticClass) {
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
1
+
<template>
2
+
<div class="md-list-item-fake-button" :disabled="disabled">
3
+
<md-list-item-content :md-disabled="isDisabled">
4
+
<slot />
5
+
</md-list-item-content>
6
+
</div>
7
+
</template>
8
+
9
+
<script>
10
+
import MdListItemMixin from './MdListItemMixin'
11
+
12
+
export default {
13
+
name: 'MdListItemFakeButton',
14
+
mixins: [MdListItemMixin]
15
+
}
16
+
</script>
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4