mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-11 07:12:26 +03:00
refresh meta info only computed $metaInfo exists
This commit is contained in:
@@ -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())
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user