修复代课下单商品搜索问题
This commit is contained in:
@@ -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;
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user