@bildvitta/quasar-ui-asteroid 3.10.0-beta.6 → 3.10.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/mixins/search-filter.js +12 -1
package/package.json
CHANGED
|
@@ -275,9 +275,20 @@ export default {
|
|
|
275
275
|
/*
|
|
276
276
|
* pode ser que as opções sejam inicializadas após o primeiro fetch de opções
|
|
277
277
|
* fazendo com que as opções sobrescreva as que vieram através do fetch, então é
|
|
278
|
-
* preciso tratar para nestes casos serem incrementadas ao invés de sobrescrever
|
|
278
|
+
* preciso tratar para nestes casos serem incrementadas ao invés de sobrescrever,
|
|
279
|
+
* mas antes é preciso verificar se já não existe nas opções filtradas para não duplicar.
|
|
279
280
|
*/
|
|
280
281
|
if (this.mx_fetchCount === 1) {
|
|
282
|
+
options.forEach(option => {
|
|
283
|
+
const index = this.mx_filteredOptions.findIndex(filteredOption => {
|
|
284
|
+
return filteredOption.value === option.value
|
|
285
|
+
})
|
|
286
|
+
|
|
287
|
+
if (~index) {
|
|
288
|
+
this.mx_filteredOptions.splice(index, 1)
|
|
289
|
+
}
|
|
290
|
+
})
|
|
291
|
+
|
|
281
292
|
this.mx_filteredOptions.unshift(...options)
|
|
282
293
|
} else {
|
|
283
294
|
this.mx_filteredOptions = [...options]
|