修复代课下单商品搜索问题
This commit is contained in:
parent
f5b36c5f0e
commit
1516b84c42
|
|
@ -1405,15 +1405,17 @@ export default {
|
|||
});
|
||||
},
|
||||
"goods.query.productId": function (newval) {
|
||||
console.log(newval);
|
||||
if (newval === "") {
|
||||
this.goods.list = this.$goodsData.records || [];
|
||||
if(!this.$goodsData){
|
||||
return
|
||||
}
|
||||
if (newval == "") {
|
||||
this.goods.list = this.$goodsData || [];
|
||||
} else {
|
||||
const newarr = this.$goodsData.records.filter((v) =>
|
||||
const newarr = this.$goodsData.filter((v) =>
|
||||
v.name.includes(newval.trim())
|
||||
);
|
||||
this.search.list = newarr;
|
||||
this.goods.list = newarr.length ? newarr : this.$goodsData.records;
|
||||
this.goods.list = newarr.length ? newarr : this.$goodsData;
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue