From 8bdd3033222e15b13c73a0942b231c8ab486f6dc Mon Sep 17 00:00:00 2001 From: heww Date: Tue, 16 May 2017 10:46:42 +0800 Subject: [PATCH] refresh meta info only computed $metaInfo exists --- src/shared/plugin.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/shared/plugin.js b/src/shared/plugin.js index 61710ee..6cb7ce5 100644 --- a/src/shared/plugin.js +++ b/src/shared/plugin.js @@ -60,13 +60,17 @@ export default function VueMeta (Vue, options = {}) { }, beforeMount () { // batch potential DOM updates to prevent extraneous re-rendering - batchID = batchUpdate(batchID, () => this.$meta().refresh()) + if (this.$metaInfo) { + batchID = batchUpdate(batchID, () => this.$meta().refresh()) + } }, destroyed () { // do not trigger refresh on the server side if (this.$isServer) return // re-render meta data when returning from a child component to parent - batchID = batchUpdate(batchID, () => this.$meta().refresh()) + if (this.$metaInfo) { + batchID = batchUpdate(batchID, () => this.$meta().refresh()) + } } }) }