2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-09 10:52:27 +03:00

Fix document is not defined error with SSR

This commit is contained in:
Blake Kostner
2017-11-28 12:52:04 -07:00
committed by GitHub
parent 5acf4cbe45
commit f6baceb864
+1 -1
View File
@@ -55,7 +55,7 @@ export default function VueMeta (Vue, options = {}) {
// if computed $metaInfo exists, watch it for updates & trigger a refresh
// when it changes (i.e. automatically handle async actions that affect metaInfo)
// credit for this suggestion goes to [Sébastien Chopin](https://github.com/Atinux)
if (this.$metaInfo) {
if (this.$isServer && this.$metaInfo) {
this.$watch('$metaInfo', () => {
// batch potential DOM updates to prevent extraneous re-rendering
batchID = batchUpdate(batchID, () => this.$meta().refresh())