• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Access to current instance State Vue

Resolved: Access to current instance State Vue

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I am trying to access to currents errors store data from Vue but i have not the expected result
When i review the complete log with
enter image description here
The info that i want is allowed in a proxy target object

Answer:

Without more detail I can only guess.
My guess is that it’s just a matter of timing. What’s likely happening is that where you are trying to get the contents of store.state.auth.errors, the value is still null. But when you log store.state.auth it returns a Proxy which stays up to date in the dev tools. So when you expand the content of the Proxy, it has already been set.

How to validate


If you capture the current value console.log(JSON.stringify(store.state.auth,null,2)) you can see value logged at the time when the console log is called.

How to deal with it


This will depend on what exactly is going on with the rest of your code. If you are relying on an API call, use the then/catch to deal with it. you can also use a watch or computed to track the changes if you want to map it to a method call or an error message.

If you have better answer, please add a comment about this, thank you!

vuejs3 vuex
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Convert function is not working with {fn } in SQL Server

24/03/2023

Resolved: Why reference in pointer array doesn’t have data?

24/03/2023

Resolved: EntityFramework creates/runs migrations using parameterless DataContext instance

24/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.