2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-21 06:40:34 +03:00

feat: child can indicate parent vmid to be removed (resolves: #288)

This commit is contained in:
pimlie
2019-03-08 15:25:57 +01:00
committed by Alexander Lichter
parent 22e456cbe2
commit 915fedfb7f
2 changed files with 55 additions and 0 deletions
+7
View File
@@ -25,6 +25,13 @@ export function arrayMerge({ component, tagIDKeyName, metaTemplateKeyName, conte
return
}
// if source specifies null as content then ignore both the target as the source
if (sourceItem[contentKeyName] === null || sourceItem.innerHTML === null) {
// remove current index from source array so its not concatenated to destination below
source.splice(sourceIndex, 1)
return
}
// we now know that targetItem is a duplicate and we should ignore it in favor of sourceItem
// now we only need to check if the target has a template to combine it with the source
const targetTemplate = targetItem[metaTemplateKeyName]