Skip to content

Typescript error accessing this #1151

Closed Answered by posva
kinoli asked this question in Help and Questions
Mar 16, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

you need to use a normal function instead:

getters: {
  details(state) {
    this.
  }
}

Arrow functions bind their context to the context they are defined at: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@nguyendvwanosoft
Comment options

@elisechant
Comment options

Answer selected by posva
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants