Skip to content
Permalink
Browse files

feat(MdApp): custom class and style (#1256)

1254
  • Loading branch information...
VdustR authored and marcosmoura committed Dec 5, 2017
1 parent 72bba16 commit 90733136b2dd6a3d166848f20ad266b7114bef38
Showing with 12 additions and 2 deletions.
  1. +12 −2 src/components/MdApp/MdApp.vue
@@ -46,7 +46,7 @@
export default {
name: 'MdApp',
functional: true,
render (createElement, { children, props }) {
render (createElement, { children, props, data }) {
let appComponent = MdAppSideDrawer
const { context, functionalContext, componentOptions } = createElement(appComponent)
const slots = buildSlots(children, context, functionalContext, componentOptions)
@@ -58,8 +58,18 @@
}
})
const staticClass = {}
if (data.staticClass) {
data.staticClass.split(/\s+/).forEach(name => {
if (name.length === 0) return
staticClass[name] = true
})
}
return createElement(appComponent, {
attrs: props
attrs: props,
class: {...staticClass, ...data.class},
style: {...data.staticStyle, ...data.style},
}, slots)
}
}

0 comments on commit 9073313

Please sign in to comment.
You can’t perform that action at this time.