2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-18 11:20:33 +03:00

refactor: destroyed never runs on server anyway

This commit is contained in:
pimlie
2019-09-12 12:28:43 +02:00
parent 1854018852
commit 631cc9c9c9
+1 -3
View File
@@ -66,7 +66,6 @@ export default function createMixin (Vue, options) {
// credit for this suggestion goes to [Sébastien Chopin](https://github.com/Atinux)
ensuredPush(this.$options, 'created', () => {
this.$watch('$metaInfo', () => {
this.__metaInfo = undefined
triggerUpdate(this, 'watcher')
})
})
@@ -142,10 +141,9 @@ export default function createMixin (Vue, options) {
// TODO: move back into beforeCreate when Vue issue is resolved
destroyed () {
// do not trigger refresh:
// - on the server side
// - when the component doesnt have a parent
// - doesnt have metaInfo defined
if (this.$isServer || !this.$parent || !hasMetaInfo(this)) {
if (!this.$parent || !hasMetaInfo(this)) {
return
}