added searchinfos
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
<template>
|
||||
<div id="Base">
|
||||
<h1>Base</h1>
|
||||
<h1 class="page-title">{{ pagetitle }}</h1>
|
||||
<aside class="search-info">
|
||||
{{ searchinfos }}
|
||||
</aside>
|
||||
<div class="results">
|
||||
<ul>
|
||||
<li v-for="item in items" v-bind:key="item.nid">
|
||||
@@ -20,9 +23,16 @@ import { mapState, mapActions } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: "Base",
|
||||
data() {
|
||||
return {
|
||||
pagetitle:"Base",
|
||||
// searchinfos: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
items: state => state.Search.items
|
||||
items: state => state.Search.items,
|
||||
searchinfos: state => state.Search.infos
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
@@ -37,6 +47,7 @@ export default {
|
||||
if(params.has('keys') || params.has('term')){
|
||||
this.$store.commit('Search/setKeys', params.get('keys'))
|
||||
this.$store.commit('Search/setTerm', params.get('term'))
|
||||
this.pagetitle = params.get('keys')
|
||||
this.newSearch()
|
||||
}
|
||||
},
|
||||
@@ -45,6 +56,7 @@ export default {
|
||||
console.log('Base beforeRouteUpdate', to, from, next);
|
||||
this.$store.commit('Search/setKeys', to.query.keys)
|
||||
this.$store.commit('Search/setTerm', to.query.term)
|
||||
this.pagetitle = to.query.keys
|
||||
this.newSearch()
|
||||
next()
|
||||
},
|
||||
|
Reference in New Issue
Block a user