2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-13 11:32:24 +03:00

Merge pull request #97 from heww/master

refresh meta info only computed $metaInfo exists
This commit is contained in:
Sébastien Chopin
2017-05-16 17:25:03 +02:00
committed by GitHub
+6 -2
View File
@@ -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())
}
}
})
}