Vue JS returns [__ob__: Observer] data instead of my array of objects

后端 未结 11 843
予麋鹿
予麋鹿 2020-12-08 08:54

I\'ve created a page where I want to get all my data from the database with an API call, but I\'m kinda new to VueJS and Javascript aswell and I don\'t know where I\'m getti

11条回答
  •  悲&欢浪女
    2020-12-08 09:38

    This happens because Vue js convert every item in the data to something that can be observed. So it makes sense if you console log something in the data. The output will be something wrapped into an observer.

    To have a better vision on your data I suggest you to install the Vue dev tools. https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd?hl=en

提交回复
热议问题