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

Favor function syntax over per-attribute function syntax

This commit is contained in:
Declan de Wet
2016-11-10 15:28:21 +02:00
parent 7c58dfc725
commit 495f61629a
12 changed files with 87 additions and 79 deletions
+2 -12
View File
@@ -25,7 +25,7 @@ export default function getMetaInfo (component) {
}
// collect & aggregate all metaInfo $options
const { mergedOption: info, deepestComponentWithMetaInfo } = getComponentOption({
const info = getComponentOption({
component,
option: 'metaInfo',
deep: true,
@@ -71,15 +71,5 @@ export default function getMetaInfo (component) {
info.base = Object.keys(info.base).length ? [info.base] : []
}
const metaInfo = deepmerge(defaultInfo, info)
// inject component context into functions & call to normalize data
Object.keys(metaInfo).forEach((key) => {
const val = metaInfo[key]
if (typeof val === 'function') {
metaInfo[key] = val.call(deepestComponentWithMetaInfo)
}
})
return metaInfo
return deepmerge(defaultInfo, info)
}