Vue Getter & Setter instead of the actual values in backend response

前端 未结 2 1777
暖寄归人
暖寄归人 2021-01-14 21:22

I\'m new to Vue and I\'m struggling to understand why my problem is happening.

When I make a call to my backend to retrieve some data the response is as follows:

相关标签:
2条回答
  • 2021-01-14 22:02

    Use the JSON stringify function:

    JSON.stringify(response.data.allEpisodes)
    
    0 讨论(0)
  • 2021-01-14 22:24

    https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function

    you can change data to be an object instead of a function, but not recommend. If Vue didn’t have this rule, clicking on one component would affect the data of all other instances.

    0 讨论(0)
提交回复
热议问题