🐞 fix: 部分位置需要判空

This commit is contained in:
砂糖
2025-08-11 16:17:27 +08:00
parent 542b481155
commit 6f415c44d1
7 changed files with 21 additions and 17 deletions

View File

@@ -62,9 +62,9 @@ export default {
watch: {
productId: {
handler(newVal) {
this.product = this.productMap && this.productMap[this.productId]
? { ...this.productMap[this.productId] }
: {};
const res = this.productMap[this.productId] ? this.productMap[this.productId] : {};
console.log(res)
this.product = res;
},
immediate: true
}