From a4e61d8247b742ebdf77c68856c6e3c5ca5e60e8 Mon Sep 17 00:00:00 2001 From: minimo-io Date: Thu, 20 Oct 2022 19:10:23 -0300 Subject: [PATCH] No results message. --- mo-lunfardo/data/lunfardo-dict-es.json | 2 +- mo-lunfardo/lunfardo.js | 18 ++++++++++-------- mo-lunfardo/test.html | 7 ++++--- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/mo-lunfardo/data/lunfardo-dict-es.json b/mo-lunfardo/data/lunfardo-dict-es.json index 9e5b7d8..95d2c5c 100644 --- a/mo-lunfardo/data/lunfardo-dict-es.json +++ b/mo-lunfardo/data/lunfardo-dict-es.json @@ -132,7 +132,7 @@ { "t": "Batifondo", "d": "Alboroto, follon." }, { "t": "Batilana", "d": "Delator." }, { "t": "Batir", "d": "Confesar, delatar, denunciar," }, - { "t": "decir la verdad Batir la justa", "d": "Decir la verdad." }, + { "t": "Batir la justa", "d": "Decir la verdad." }, { "t": "Batuque", "d": "Alboroto, fiesta ruidosa." }, { "t": "Beberaje", "d": "Bebida alcohólica." }, { "t": "Bebestible", "d": "Bebida." }, diff --git a/mo-lunfardo/lunfardo.js b/mo-lunfardo/lunfardo.js index fddddd6..703eecd 100644 --- a/mo-lunfardo/lunfardo.js +++ b/mo-lunfardo/lunfardo.js @@ -1,12 +1,12 @@ // Runs at https://minimo.io/diccionario-de-lunfardo-2020062059/, loaded via jsdelivr (fetched from Github) // @minimo-io -// v.0.1 const App = Vue.createApp({ data(){ return { placeholder: 'Buscá che...', searchQuery: '', + noResults: false, wordsJson: [] } }, @@ -40,13 +40,15 @@ const App = Vue.createApp({ //return this.listValues.slice(0, 10); return this.listValues.slice(0, 50); } - return this.listValues - .map((v) => { - if (this.matches(v)) { - return v; - } - }) - .filter((v) => v); + var filteredValues = this.listValues + .map((v) => { + if (this.matches(v)) { + return v; + } + }) + .filter((v) => v); + if (filteredValues.length <= 0) this.noResults = true; + return filteredValues; } }, diff --git a/mo-lunfardo/test.html b/mo-lunfardo/test.html index 118ffe6..4358fd7 100644 --- a/mo-lunfardo/test.html +++ b/mo-lunfardo/test.html @@ -12,7 +12,7 @@
-
+
@@ -22,8 +22,9 @@
{{ countWords }} palabras
Ingresá tu búsqueda en cuadro de arriba y recorré mas de {{ countWords }} palabras lunfardas. -
-

Algunos ejemplos de términos lunfardos

+
+

Epa ché, sabés que todavía no se ha inventado ese término. Si existe, ponete en contacto y lo agregamos.

+

Algunos ejemplos

  • {{ data.t }}: {{ data.d }}