localstorage 객체 값을 업데이트하는 방법 & jquery를 사용하여 저장합니까?
아래는 내가 시도한 코드입니다.
var cachekey = "shop/elasticCache/sku$$" + this.product.parentSku
const { category } = JSON.parse(
localStorage.getItem("shop/elasticCache/sku$$" + this.product.parentSku)
)
var productcache = []
productcache = localStorage.getItem(cachekey)
var updatedproductcache = JSON.parse(productcache)
updatedproductcache.name = category
productcache = JSON.stringify(updatedproductcache)
localStorage.setItem(cachekey, productcache)
localstorage json에서 category
데이터를 업데이트하려고합니다.