localStorage对于不同进程之间是不同步的,在a窗口中setItem,在b窗口中getItem是有可能拿到旧值的(其实我也不确定是因为localStorage不同步,还是react或者预览器的缓存机制)
1