search

Home  >  Q&A  >  body text

objective-c - Use axios to modify data through vuex mutation getter failed for the first time and succeeded for the second time

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

伊谢尔伦伊谢尔伦2707 days ago1211

reply all(2)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-06-28 09:29:29

    @tony_gong

    The data also exists here

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-06-28 09:29:29

    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

    reply
    0
  • Cancelreply