Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(MdApp): child.data.attrs is undefined #1762

Merged
merged 2 commits into from
May 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/components/MdApp/MdApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,21 @@
return (data && componentTypes.includes(data.slot)) || isValidChild(componentOptions)
}

function generateAttrKeys (attrs) {
return JSON.stringify({
'persistent': attrs && attrs['md-persistent'],
'permanent': attrs && attrs['md-permanent']
})
}

function buildSlots (children, context, functionalContext, options, createElement) {
let slots = []

let hasDrawer = false

if (children) {
children.forEach(child => {
/* eslint-enable */
const data = child.data
const componentOptions = child.componentOptions

Expand All @@ -53,10 +61,7 @@

hasDrawer = true
child.data.slot += `-${isRight ? 'right' : 'left'}`
child.key = JSON.stringify({
'persistent': child.data.attrs['md-persistent'],
'permanent': child.data.attrs['md-permanent']
})
child.key = generateAttrKeys(data.attrs)

createRightDrawer(isRight)
}
Expand Down