Something went wrong on our end
-
Ole Voldsæter authoredOle Voldsæter authored
SearchResults.vue 761 B
<template>
<section class="">
<h2 v-if="hits.length">Søkeresultater</h2>
<ul>
<li v-for="(result, index) in extended_results" :key="index">
<a :href="'/' + result.id">{{result.label}}</a> ({{result.classification}})
</li>
</ul>
</section>
</template>
<script>
import helpers from '../utils/helpers.js'
export default {
name: 'SearchResults',
props: {
hits: Array,
lang: String
},
computed: {
extended_results: function(){
return this.hits.map(
function(hit){
return {
id: hit._id,
label: hit._source.lemmas.map(x => x.lemma).join(', '),
classification: helpers.group_list(hit._source.lemmas)
}
})
}
}
}
</script>