修复代课下单商品搜索问题
This commit is contained in:
@@ -1405,15 +1405,17 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
"goods.query.productId": function (newval) {
|
"goods.query.productId": function (newval) {
|
||||||
console.log(newval);
|
if(!this.$goodsData){
|
||||||
if (newval === "") {
|
return
|
||||||
this.goods.list = this.$goodsData.records || [];
|
}
|
||||||
|
if (newval == "") {
|
||||||
|
this.goods.list = this.$goodsData || [];
|
||||||
} else {
|
} else {
|
||||||
const newarr = this.$goodsData.records.filter((v) =>
|
const newarr = this.$goodsData.filter((v) =>
|
||||||
v.name.includes(newval.trim())
|
v.name.includes(newval.trim())
|
||||||
);
|
);
|
||||||
this.search.list = newarr;
|
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