handled home loading if not available in dom (if drupalSettings.path.isFront == false)

This commit is contained in:
2019-06-04 22:38:44 +02:00
parent d8e5f93c14
commit 082e011fbb
22 changed files with 591 additions and 160 deletions
@@ -28,6 +28,31 @@ export default {
items: state => state.Search.items
})
},
methods: {
...mapActions({
newSearch: 'Search/newSearch'
})
},
created() {
// laucnh a search if params exists in url query
console.log('Base created() location',window.location);
let params = new URLSearchParams(window.location.search)
if(params.has('keys')){
this.$store.commit('Search/setKeys', params.get('keys'))
this.newSearch()
}
},
// beforeRouteEnter (to, from, next) {
// console.log('Base beforeRouteEnter');//, to, from, next);
// next()
// },
beforeRouteUpdate (to, from, next) {
console.log('Base beforeRouteUpdate', to, from, next);
this.$store.commit('Search/setKeys', to.query.keys)
this.$store.commit('Search/setTerm', to.query.term)
this.newSearch()
next()
},
components: {
Card
}