mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-24 02:40:33 +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 () {
|
beforeMount () {
|
||||||
// batch potential DOM updates to prevent extraneous re-rendering
|
// 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 () {
|
destroyed () {
|
||||||
// do not trigger refresh on the server side
|
// do not trigger refresh on the server side
|
||||||
if (this.$isServer) return
|
if (this.$isServer) return
|
||||||
// re-render meta data when returning from a child component to parent
|
// 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