1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-10 12:01:57 +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 clearable
style="width: 100%;" style="width: 100%;"
popper-class="custom-field-prodcut-info" popper-class="custom-field-prodcut-info"
:trigger-on-focus="true"
:fetch-suggestions="localSearch" :fetch-suggestions="localSearch"
:select-when-unmatched="true" :select-when-unmatched="true"
:highlight-first-item="true"
@shortkey.native="shortcutKeyMethod" @shortkey.native="shortcutKeyMethod"
@select="handleSelect" @select="handleSelect"
> >
@ -162,12 +164,6 @@ export default {
} }
}, },
localSearch(stringToMatch, callBack) { localSearch(stringToMatch, callBack) {
if (this.isEmptyValue(stringToMatch)) {
// not show list
callBack([])
return
}
let results = this.listWithPrice let results = this.listWithPrice
if (!this.isEmptyValue(stringToMatch)) { if (!this.isEmptyValue(stringToMatch)) {
const parsedValue = stringToMatch.toLowerCase().trim() const parsedValue = stringToMatch.toLowerCase().trim()

View File

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

View File

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

View File

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