Skip to content
Snippets Groups Projects
Commit a9808150 authored by Ole Voldsæter's avatar Ole Voldsæter
Browse files

re meta#269 randomiserer "key" på artiklene så de tvinges til re-render

parent c619eb6a
No related branches found
No related tags found
No related merge requests found
......@@ -2,13 +2,13 @@
<section id="search_results">
<div class="flex-container">
<ul class="hits" v-if="results_bob.length">
<li class="article_container" v-for="(result, index) in results_bob" :key="index">
<li class="article_container" v-for="(result, index) in results_bob" :key="index + results_hash">
<Article :article="result" @article-click="article_link_click">
</Article>
</li>
</ul>
<ul class="hits" v-if="results_nob.length">
<li class="article_container" v-for="(result, index) in results_nob" :key="index">
<li class="article_container" v-for="(result, index) in results_nob" :key="index + results_hash">
<Article :article="result" @article-click="article_link_click">
</Article>
</li>
......@@ -32,6 +32,9 @@ export default {
},
results_nob: function(){
return this.hits.filter(hit => hit.dictionary == 'nob')
},
results_hash: function(){
return this.hits.reduce((hash, hit) => (hash + hit) % 10000)
}
},
methods: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment