2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-20 12:40:34 +03:00

test: add e2e tests

This commit is contained in:
pimlie
2019-03-21 13:56:15 +01:00
committed by Pim
parent 1acadbc1b4
commit 717c30303f
12 changed files with 5749 additions and 770 deletions
+6 -3
View File
@@ -47,7 +47,7 @@ export default function createMixin(Vue, options) {
// coerce function-style metaInfo to a computed prop so we can observe
// it on creation
if (isFunction(this.$options[options.keyName])) {
if (isUndefined(this.$options.computed)) {
if (!this.$options.computed) {
this.$options.computed = {}
}
this.$options.computed.$metaInfo = this.$options[options.keyName]
@@ -82,7 +82,7 @@ export default function createMixin(Vue, options) {
}
})
// add the navigation guards if they havent been added yet
// add the navigation guards if requested
if (options.refreshOnceOnNavigation) {
addNavGuards(this)
}
@@ -94,7 +94,10 @@ export default function createMixin(Vue, options) {
// add the navigation guards if they havent been added yet
// if metaInfo is defined as a function, this does call the computed fn redundantly
// but as Vue internally caches the results of computed props it shouldnt hurt performance
if (!options.refreshOnceOnNavigation && this.$options[options.keyName].afterNavigation) {
if (!options.refreshOnceOnNavigation && (
(this.$options[options.keyName] && this.$options[options.keyName].afterNavigation) ||
(this.$options.computed && this.$options.computed.$metaInfo && (this.$options.computed.$metaInfo() || {}).afterNavigation)
)) {
addNavGuards(this)
}