2019-09-27 16:02:48 +00:00
|
|
|
import { Component, Vue, Prop, Provide } from 'vue-property-decorator';
|
2019-10-03 16:54:05 +00:00
|
|
|
import VsInput from './text-search/vs-input.vue';
|
|
|
|
import VsResults from './search-results/vs-results.vue';
|
|
|
|
import FacetList from './search-results/facet-list.vue'
|
|
|
|
import rdrApi from './search-results/dataservice';
|
2019-09-27 16:02:48 +00:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
components: {
|
2019-10-03 16:54:05 +00:00
|
|
|
VsInput,
|
|
|
|
VsResults,
|
|
|
|
FacetList
|
2019-09-27 16:02:48 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
export default class App extends Vue {
|
|
|
|
|
|
|
|
results = [];
|
2019-10-03 16:54:05 +00:00
|
|
|
facets = [];
|
2019-09-27 16:02:48 +00:00
|
|
|
bar = 'bar';
|
|
|
|
|
|
|
|
async onSearch(term) {
|
|
|
|
console.log(term);
|
2019-10-03 16:54:05 +00:00
|
|
|
// this.results = await rdrApi.search(term);
|
|
|
|
var res = await rdrApi.search(term);
|
|
|
|
this.results = res.response.docs;
|
|
|
|
this.facets = res.facet_counts.facet_fields;
|
2019-09-27 16:02:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
mounted() {
|
2019-10-04 17:00:31 +00:00
|
|
|
// console.log('Component mounted.')
|
2019-09-27 16:02:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|