vuejs / vue

This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
http://v2.vuejs.org
MIT License
208.02k stars 33.69k forks source link

Inconsistent behavior when using deep objects in vuex with SSR #8302

Open Sopamo opened 6 years ago

Sopamo commented 6 years ago

Version

2.5.16

Reproduction link

https://github.com/Sopamo/vue-ssr-deep-state-bug-reproduction

Steps to reproduce

What is expected?

The class of both divs should reflect the value of their variables

What is actually happening?

The classes of both elements are wrong (they have the class "true" despite them having changed to "false"). The issue is gone when you navigate between page B and page A. The issue only occurs when you are reloading the browser on page A.


The inital state is that both variables are true. They are both being set to false in the entry-client.js file with the store.replaceState method.

Sopamo commented 6 years ago

I had a bug in the code (which I fixed) which made it appear like the "deepness" is an issue. It isn't. I updated the reproduction link and the issue description accordingly. I also forgot to mention that when outputting the value of the variables they are correct, only when using them as a class they do not work. You see this in the reproduction.