2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-14 14:02:27 +03:00

change to more versatile merge behaviour

This commit is contained in:
Declan de Wet
2016-11-04 09:02:57 +02:00
parent 70a1578e7f
commit 716307a2ce
3 changed files with 89 additions and 28 deletions
+10 -2
View File
@@ -34,14 +34,22 @@ export default function getComponentOption (opts, result = {}) {
}
// merge with existing options
result = deepmerge(result, data, { arrayMerge })
result = deepmerge(result, data, {
clone: true,
arrayMerge
})
// collect & aggregate child options if deep = true
if (deep) {
const { $children } = component
for (let i = 0, len = $children.length; i < len; i++) {
const component = $children[i]
result = getComponentOption({ option, deep, component, arrayMerge }, result)
result = getComponentOption({
option,
deep,
component,
arrayMerge
}, result)
}
}