2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-24 23:31:43 +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) // credit for this suggestion goes to [Sébastien Chopin](https://github.com/Atinux)
ensuredPush(this.$options, 'created', () => { ensuredPush(this.$options, 'created', () => {
this.$watch('$metaInfo', () => { this.$watch('$metaInfo', () => {
this.__metaInfo = undefined
triggerUpdate(this, 'watcher') triggerUpdate(this, 'watcher')
}) })
}) })
@@ -142,10 +141,9 @@ export default function createMixin (Vue, options) {
// TODO: move back into beforeCreate when Vue issue is resolved // TODO: move back into beforeCreate when Vue issue is resolved
destroyed () { destroyed () {
// do not trigger refresh: // do not trigger refresh:
// - on the server side
// - when the component doesnt have a parent // - when the component doesnt have a parent
// - doesnt have metaInfo defined // - doesnt have metaInfo defined
if (this.$isServer || !this.$parent || !hasMetaInfo(this)) { if (!this.$parent || !hasMetaInfo(this)) {
return return
} }