mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-24 14:50:34 +03:00
refactor: just pass all options to getComponentOption
This commit is contained in:
committed by
Alexander Lichter
parent
c9a732c9d7
commit
da4bb27a4b
@@ -11,15 +11,9 @@ import getComponentOption from './getComponentOption'
|
|||||||
* @param {Object} component - the Vue instance to get meta info from
|
* @param {Object} component - the Vue instance to get meta info from
|
||||||
* @return {Object} - returned meta info
|
* @return {Object} - returned meta info
|
||||||
*/
|
*/
|
||||||
export default function getMetaInfo({ keyName, tagIDKeyName, metaTemplateKeyName, contentKeyName } = {}, component, escapeSequences = []) {
|
export default function getMetaInfo(options = {}, component, escapeSequences = []) {
|
||||||
// collect & aggregate all metaInfo $options
|
// collect & aggregate all metaInfo $options
|
||||||
let info = getComponentOption({
|
let info = getComponentOption({ ...options, component }, defaultInfo)
|
||||||
component,
|
|
||||||
keyName,
|
|
||||||
metaTemplateKeyName,
|
|
||||||
tagIDKeyName,
|
|
||||||
contentKeyName
|
|
||||||
}, defaultInfo)
|
|
||||||
|
|
||||||
// Remove all "template" tags from meta
|
// Remove all "template" tags from meta
|
||||||
|
|
||||||
@@ -53,7 +47,7 @@ export default function getMetaInfo({ keyName, tagIDKeyName, metaTemplateKeyName
|
|||||||
}
|
}
|
||||||
|
|
||||||
// begin sanitization
|
// begin sanitization
|
||||||
info = escape(info, { tagIDKeyName }, escapeSequences)
|
info = escape(info, options, escapeSequences)
|
||||||
|
|
||||||
return info
|
return info
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user