1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-07 18:25:45 +08:00

infinite loop in product table (#1043)

* infinite loop in product table

* Show suggestions when input gets focus

Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
This commit is contained in:
Elsio Sanchez 2021-08-12 17:10:51 -04:00 committed by GitHub
parent 5fa463d741
commit 2ce8853978
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 9 deletions

View File

@ -47,8 +47,10 @@
clearable
style="width: 100%;"
popper-class="custom-field-prodcut-info"
:trigger-on-focus="true"
:fetch-suggestions="localSearch"
:select-when-unmatched="true"
:highlight-first-item="true"
@shortkey.native="shortcutKeyMethod"
@select="handleSelect"
>
@ -162,12 +164,6 @@ export default {
}
},
localSearch(stringToMatch, callBack) {
if (this.isEmptyValue(stringToMatch)) {
// not show list
callBack([])
return
}
let results = this.listWithPrice
if (!this.isEmptyValue(stringToMatch)) {
const parsedValue = stringToMatch.toLowerCase().trim()

View File

@ -37,8 +37,9 @@
<el-table
ref="listProducto"
v-shortkey="shortsKey"
v-loading="isEmptyValue(listWithPrice) || isLoadedServer"
v-loading="isLoadedServer"
:data="localTableSearch(listWithPrice)"
:empty-text="$t('form.pos.tableProduct.empty')"
border
fit
height="450"

View File

@ -447,7 +447,8 @@ export default {
options: 'Options',
editQuantities: 'Edit Quantities',
pin: 'Insert Pin',
remove: 'Remove'
remove: 'Remove',
empty: 'Enter the product name, code or UPC'
},
order: {
order: 'Order',

View File

@ -423,7 +423,8 @@ export default {
options: 'Opciones',
editQuantities: 'Editar Cantidades',
pin: 'Ingrese Pin',
remove: 'Eliminar'
remove: 'Eliminar',
empty: 'Ingrese el nombre del producto, código o UPC'
},
order: {
order: 'Orden',