Newer
Older
<section id="search_results">
<div class="flex-container">
<li><h4>Bokmål</h4></li>
<Preview v-for="(result, index) in results_bob" :key="index" :searchHit="result" @click.native="article_link_click(result)">
<li><h4>Nynorsk</h4></li>
<Preview v-for="(result, index) in results_nob" :key="index" :searchHit="result" @click.native="article_link_click(result)">
</Preview>
</ul>
<ul class="hits" v-if="results_norsk.length">
<li><h4>Norsk Ordbok</h4></li>
<Preview v-for="(result, index) in results_norsk" :key="index" :searchHit="result" @click.native="article_link_click(result)">
</Preview>
</ul>
import Preview from './Preview.vue'
return this.hits.filter(hit => hit.dictionary == 'bob')
results_nob: function(){
return this.hits.filter(hit => hit.dictionary == 'nob')
return this.hits.filter(hit => hit.dictionary == 'norsk_ordbok')
article_link_click: function(result) {
this.$router.push('/' + result.dictionary + '/' + result.article_id)
this.$emit('search-hit-click', result)
},
components: {
Preview
.hits .preview {
margin: 10px;
padding: 5px;
cursor: pointer;
}
.hits .preview h4 {
text-decoration: underline;
}
.hits {
.flex-container {
display: flex;
}
.flex-container > ul {
padding: 0px;
}
.flex-container h4 {
margin: 0px;