mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-20 17:20:34 +03:00
add basic render example + fix a bug where missing root metInfo prevented fetching metaInfo from deeper in the component heirarchy
This commit is contained in:
@@ -34,22 +34,21 @@ export default function getComponentOption (opts, result = {}) {
|
||||
clone: true,
|
||||
arrayMerge
|
||||
})
|
||||
|
||||
// collect & aggregate child options if deep = true
|
||||
if (deep && component.$children.length) {
|
||||
component.$children.forEach((childComponent) => {
|
||||
result = getComponentOption({
|
||||
component: childComponent,
|
||||
option,
|
||||
deep,
|
||||
arrayMerge
|
||||
}, result)
|
||||
})
|
||||
}
|
||||
|
||||
return result
|
||||
} else {
|
||||
result = data
|
||||
}
|
||||
result = data
|
||||
}
|
||||
|
||||
// collect & aggregate child options if deep = true
|
||||
if (deep && component.$children.length) {
|
||||
component.$children.forEach((childComponent) => {
|
||||
result = getComponentOption({
|
||||
component: childComponent,
|
||||
option,
|
||||
deep,
|
||||
arrayMerge
|
||||
}, result)
|
||||
})
|
||||
}
|
||||
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user