susanBuck / e28-spring20

0 stars 0 forks source link

Vuex Store is not accessible through computed property in App.vue #104

Closed oscarxiao closed 4 years ago

oscarxiao commented 4 years ago

Hi Guys, Here is my Vuex store file

Screen Shot 2020-05-11 at 10 07 20 PM

Here is how I import and register my Vuex Store.

Screen Shot 2020-05-11 at 10 08 04 PM

I try to use it in the computed property

Screen Shot 2020-05-11 at 10 09 24 PM

and render it by {{expCount}} The inspector will show me an error saying "can not read property 'state' of undefined"

Screen Shot 2020-05-11 at 10 10 42 PM

Any ideas?

oscarxiao commented 4 years ago

if I don't render expCount, I just look into the vue inspector, in the computed section. This will show.

Screen Shot 2020-05-11 at 10 18 52 PM
susanBuck commented 4 years ago

Hi @oscarxiao -

Confirming you resolved this issue and don't need additional assistance? I see the post was closed, but you didn't note a resolution.

I've had students inadvertently close posts in the past so I just wanted to double check. : )

oscarxiao commented 4 years ago

Yes, @susanBuck. I resolved it. Thanks.

Hi @oscarxiao -

Confirming you resolved this issue and don't need additional assistance? I see the post was closed, but you didn't note a resolution.

I've had students inadvertently close posts in the past so I just wanted to double check. : )