组件中有子组件是列表时,初始值为空在初始化时会报错导致该组件失效问题的解决 #411
Closed
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.
在官方的例子中, 有一个 “测试组件Repeat" 如果初始值设置为 [] ,会报错。
我本意是,实际工作中,很多列表数据是从后台取的,初始值就是空数组,然后从网络加载。试了下,就发现报错了。看了下错误代码,就试着修复了一下,只是解决了问题,但老实说没看懂原代码,作者有时间可以好好说明下。