老师,如果是正常对象引用的话
let shop = {}
let a = shop
a.id = 11
console.log(shop.id) // 11如果是响应式引用的话
let shop = reactive({})
let a = shop
a.id = 11
console.log(shop.id) // 11现在a和shop的引用地址应该一样
但是
为什么在状态管理应用中不是这样
const { shopid, productId, productInfo } = payload
let shopInfo = state.cartList[shopid]
if (!shopInfo) shopInfo = {}
let product = shopInfo[productId]
if (!product) {
product = productInfo
product.count = 0
}
product.count += 1
shopInfo[productId] = product
state.cartList[shopid] = shopInfo如果不写最后一句话state.cartList[shopid] = shopInfo,为什么state里面的cartList没有变化呢