New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
False positives of "Property is private and only accessible within class - ts(2341)" #2576
Comments
@omnichronous I don't have the same environment, but I have a similar one with class style components. Try setting {
"vueCompilerOptions": {
// "target": 2.7,
"target": 2, // For Vue version <= 2.6.14
"experimentalUseElementAccessInTemplate": true
},
"compilerOptions": {
...
}
} The related issue that led me to this setting was: #997 |
Simply adding |
Amazing, thank you so much @hysan! Problem solved, I'll close this issue. |
Thank you so much @hysan, it's working here!! |
First of all, thank you for your work and support. I've read through a lot of issues here and in related repositories but I still can't understand why I see these errors.
Here is the environment of the project I'm working on:
TypeScript and JavaScript Language Features
built-in extension disabled, as per Takeover modeThe errors appear when I access methods and properties defined as
private
from the template.To my understanding the template in a SFC is compiled down to a render function which works the same way as if you had defined it in the component options, i.e. it would be a member of the same class, so it would have no problems calling private methods in that same class. And indeed when I run the project everything works normally.
The text was updated successfully, but these errors were encountered: