mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-20 10:10:34 +03:00
fix: still traverse children when metainfo doesnt return object (#469)
* chore: ignore isServer for coverage * fix: still traverse children when metainfo doesnt return object
This commit is contained in:
@@ -40,13 +40,12 @@ export function getComponentOption (options, component, result) {
|
||||
// because Vue caches those internally
|
||||
const data = $metaInfo || $options[keyName]
|
||||
|
||||
// ignore data if its not an object, then we keep our previous result
|
||||
if (!isObject(data)) {
|
||||
return result
|
||||
// only merge data with result when its an object
|
||||
// eg it could be a function when metaInfo() returns undefined
|
||||
// dueo to the or statement above
|
||||
if (isObject(data)) {
|
||||
result = merge(result, data, options)
|
||||
}
|
||||
|
||||
// merge with existing options
|
||||
result = merge(result, data, options)
|
||||
}
|
||||
|
||||
// collect & aggregate child options if deep = true
|
||||
|
||||
@@ -135,6 +135,7 @@ export default function createMixin (Vue, options) {
|
||||
|
||||
// do not trigger refresh on the server side
|
||||
if (this.$isServer) {
|
||||
/* istanbul ignore next */
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user