Vue Getter & Setter instead of the actual values i

2020-03-26 08:39发布

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:

id: Getter & Setter
name: Getter & Setter
season: Getter & Setter
number: Getter & Setter

Within Vue, if I change data to be an object instead of a function, I get the values I expect.

id:10897
name:"Minimum Viable Product"
season:1
number:1

From reading Vue's documentation I know data should be a function, however I don't see why it affects the data I am getting?

I retrieve the data like so:

methods: {
     async episodes() {
      const response = await EpisodesService.getAllEpisodes()
      console.log(response)
}

0条回答
登录 后发表回答