From a9808150eac27156795ac8e3d1a1624d0fc6219e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Volds=C3=A6ter?= <ole.voldsater@uib.no> Date: Fri, 12 Feb 2021 09:16:40 +0100 Subject: [PATCH] =?UTF-8?q?re=20meta#269=20randomiserer=20"key"=20p=C3=A5?= =?UTF-8?q?=20artiklene=20s=C3=A5=20de=20tvinges=20til=20re-render?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SearchResults.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/SearchResults.vue b/src/components/SearchResults.vue index d87e3c43..6e02c58e 100644 --- a/src/components/SearchResults.vue +++ b/src/components/SearchResults.vue @@ -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: { -- GitLab