+13
-15
lines changedFilter options
+13
-15
lines changed Original file line number Diff line number Diff line change
@@ -14,16 +14,9 @@
14
14
return componentOptions && componentTypes.includes(componentOptions.tag)
15
15
}
16
16
17
-
function isRightDrawer ({ mdRight }) {
18
-
return mdRight === '' || !!mdRight
19
-
}
20
-
21
-
function createRightDrawer (isMdRight) {
22
-
if (isMdRight) {
23
-
const drawerRightPrevious = createElement(MdDrawerRightPrevious, { props: {...child.data.attrs}})
24
-
drawerRightPrevious.data.slot = 'md-app-drawer-right-previous'
25
-
slots.push(drawerRightPrevious)
26
-
}
17
+
function isRightDrawer (propsData) {
18
+
if (!propsData) return false
19
+
return propsData.mdRight === '' || !!propsData.mdRight
27
20
}
28
21
29
22
function shouldRenderSlot (data, componentOptions) {
@@ -49,9 +42,10 @@
49
42
const componentOptions = child.componentOptions
50
43
51
44
if (shouldRenderSlot(data, componentOptions)) {
52
-
child.data.slot = data.slot || componentOptions.tag
45
+
const slotName = data.slot || componentOptions.tag
46
+
child.data.slot = slotName
53
47
54
-
if (componentOptions.tag === 'md-app-drawer') {
48
+
if (slotName === 'md-app-drawer') {
55
49
const isRight = isRightDrawer(componentOptions.propsData)
56
50
57
51
if (hasDrawer) {
@@ -63,7 +57,11 @@
63
57
child.data.slot += `-${isRight ? 'right' : 'left'}`
64
58
child.key = generateAttrKeys(data.attrs)
65
59
66
-
createRightDrawer(isRight)
60
+
if (isRight) {
61
+
const drawerRightPrevious = createElement(MdDrawerRightPrevious, { props: {...child.data.attrs}})
62
+
drawerRightPrevious.data.slot = 'md-app-drawer-right-previous'
63
+
slots.push(drawerRightPrevious)
64
+
}
67
65
}
68
66
69
67
child.data.provide = options.Ctor.options.provide
@@ -80,9 +78,9 @@
80
78
81
79
function getDrawers (children) {
82
80
const drawerVnodes = children.filter(child => {
83
-
return child.componentOptions.tag === 'md-app-drawer'
81
+
const tag = child.data.slot || child.componentOptions.tag
82
+
return tag === 'md-app-drawer'
84
83
})
85
-
86
84
return drawerVnodes.length ? drawerVnodes : []
87
85
}
88
86
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