mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-25 01:40:33 +03:00
refactor: destroyed never runs on server anyway
This commit is contained in:
+1
-3
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user