Skip to content

VSCode throw error "Property does not exist on type" when referencing to another getter #1299

Discussion options

You must be logged in to vote

You need to type the return:

 totalDiscount(): number | undefined {
      return this.subTotal;
    },

See https://pinia.vuejs.org/core-concepts/getters.html#getters

Replies: 6 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@tech-goldenphoenix
Comment options

@zachbryant
Comment options

Answer selected by tech-goldenphoenix
Comment options

You must be logged in to vote
1 reply
@septatrix
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jumika
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
9 participants
Converted from issue

This discussion was converted from issue #1298 on May 16, 2022 12:19.