Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
场景:
组件树:(R为根组件;C1为R的子组件;C11、C12为C1的子组件, C11,C12下面还有很多下层组件)
R
|___C1
|____C11
|____C12
|___C1
|____C11
|____C12
|___C1
|____C11
|____C12
C1的每个实例的数据显示是不一样的, 如果使用props传递数据,将会导致所有组件的实例要知道自己的index,不然不知道去修改哪个state。如果vuex支持延时创建store,那么在C1 上面延时生成store,下层组件使用$store的时候,不需要关心当前是哪个store的。