JavaScript/vue.js/store:修订间差异
来自康健生活
无编辑摘要 |
|||
| 第166行: | 第166行: | ||
[[文件:Vue new store 6.png|600px|none|无|Vue new store 6]] | [[文件:Vue new store 6.png|600px|none|无|Vue new store 6]] | ||
但实际情况却是这样: | |||
[[文件:Vue new store 7.png|600px|none|无|Vue new store 7]] | [[文件:Vue new store 7.png|600px|none|无|Vue new store 7]] | ||
实际上由于加载新页面时是使用 <code>async asyncData</code> 在服务端跑接口,导致 session 更新 store 与 asyncData 中接口更新 store 是一个并行竞争问题。所以抛错。 | |||
解决办法: | 解决办法: | ||