-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
strictTemplates errors on class, id, @click #3443
Comments
This one seems to be resolved in 2.x. Feel free to create a new issue if you're still having issues, thanks! |
I'm still seeing the 3rd case:
Adding a redundant prop still works as a workaround.
|
Can you be more specific about the 3rd point? Can you reproduce on https://play.vuejs.org/? |
Line 19 is an error, 20 and 21 are not.
https://stackblitz.com/edit/vitejs-vite-bukhvb?file=src%2FApp.vue |
It works on my machine with latest version of |
Same, @Doeke please share more information about your setup (open a new issue to get inspired by a good issue template). |
Yea, bumping vue fixes that stackblitz Still have the local issue, but i'll make a new issue when I can replicate in a useful way |
Done: Hope this is enough information, would really like to be able to use the |
In some situations type checking fails on basic attributes and events when
strictTemplates: true
In this repro link I demonstrate 3 different issues (run
npx vue-tsc
):https://stackblitz.com/edit/vitejs-vite-avohbf?file=src%2FApp.vue
id=".."
to component tag sometimes causesObject literal may only specify known properties, and 'id' does not exist in type ...
class=".."
is not allowed in some cases for example with Transition/TransitionGroup and causesObject literal may only specify known properties, but 'class' does not exist in type 'TransitionProps'
@click="onClick"
is not allowed on component tags (but only if there are no props defined?) and causesType '{ onClick: any; }' has no properties in common with type
The first two (id and class) can be worked around by adding
dataAttributes: ["id", "class"]
to tsconfig. For@click
errors a workaround seems to be to define one or more props on the tag.The text was updated successfully, but these errors were encountered: