How to correctly type the "this" keyword referencing the Pinia-store itself #12023
Unanswered
DevKame
asked this question in
Help/Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is a function within my piniaStore of my Vue+TS project:
My issue is with the word "this". It works but my ts compiler is crying.
getAllUsers is a computed property within my store and i want to access it using the this keyword.
Like i said, it works fine but, again, typescript is throwing errors:
![Screenshot 2024-09-24 200628](https://private-user-images.githubusercontent.com/123653405/370409975-84c03c8f-5bed-4921-bc81-121d126e23c0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NDE3NzAsIm5iZiI6MTczOTQ0MTQ3MCwicGF0aCI6Ii8xMjM2NTM0MDUvMzcwNDA5OTc1LTg0YzAzYzhmLTViZWQtNDkyMS1iYzgxLTEyMWQxMjZlMjNjMC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxM1QxMDExMTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mMjM0ZmNiNjk0OWY3Mjk0NDUwMTk4MDRmMDUyMTZlNDBjZGMyM2Q3ZDY3YTZmM2JkYzc3ZDVjZWVjODRmYjVjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9._EpT_r2DmMruRRnbVBNinWw-y_G4nNj3MYTHDUPHa1M)
When i hover over the this keyword it says this:
How do i type this correctly?
Beta Was this translation helpful? Give feedback.
All reactions