objective-c - Use axios to modify data through vuex mutation getter failed for the first time and succeeded for the second time
伊谢尔伦2017-06-28 09:27:29
0
2
1192
The first getter is undefined But after the data is changed, the getter data becomes available Shouldn’t the getter data be changed accordingly What is the reason for this
The first time getSongList in your state is {}, so when you print it, it must be {__ob__:Observer}, because computed is related to dependencies. If dependencies change, the data in computed will change, so you will mutate later The data is requested and getSongList has a value, so the printing is different. You can try changing getSongList to null and you will know
@tony_gong
The data also exists here
The first time getSongList in your state is {}, so when you print it, it must be {__ob__:Observer}, because computed is related to dependencies. If dependencies change, the data in computed will change, so you will mutate later The data is requested and getSongList has a value, so the printing is different. You can try changing getSongList to null and you will know