fixed webpack prod, fixed language prefix negociation in vue-router
This commit is contained in:
@@ -20,9 +20,6 @@ import { mapState, mapActions } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: "Base",
|
||||
data: () => ({
|
||||
|
||||
}),
|
||||
computed: {
|
||||
...mapState({
|
||||
items: state => state.Search.items
|
||||
@@ -34,19 +31,17 @@ export default {
|
||||
})
|
||||
},
|
||||
created() {
|
||||
// laucnh a search if params exists in url query
|
||||
// at first page load or first route entering launch 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')){
|
||||
if(params.has('keys') || params.has('term')){
|
||||
this.$store.commit('Search/setKeys', params.get('keys'))
|
||||
this.$store.commit('Search/setTerm', params.get('term'))
|
||||
this.newSearch()
|
||||
}
|
||||
},
|
||||
// beforeRouteEnter (to, from, next) {
|
||||
// console.log('Base beforeRouteEnter');//, to, from, next);
|
||||
// next()
|
||||
// },
|
||||
beforeRouteUpdate (to, from, next) {
|
||||
// when query change launch a new search
|
||||
console.log('Base beforeRouteUpdate', to, from, next);
|
||||
this.$store.commit('Search/setKeys', to.query.keys)
|
||||
this.$store.commit('Search/setTerm', to.query.term)
|
||||
|
@@ -1,7 +1,8 @@
|
||||
<template lang="html">
|
||||
<div :id="id">
|
||||
<router-view name="home" :html="home_template_src"></router-view>
|
||||
<router-view name="base"></router-view>
|
||||
<!-- <router-view name="home" :html="home_template_src"></router-view> -->
|
||||
<!-- <router-view name="base"></router-view> -->
|
||||
<router-view :html="home_template_src"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
Reference in New Issue
Block a user