We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In my template I'm rendering a Vue component and specify the class and style attribute on the tag, like so:
<MyComponent class="my-class" style="font-weight: bold" data-value="test" />
I get a type error, saying:
Type '{ class: string; dataValue: any; "data-value": any; }' is not assignable to type 'IntrinsicAttributes & Readonly<Partial<{ selected: boolean; }> & Omit<{ selected: boolean; } & {}, "selected">>'. Property 'class' does not exist on type 'IntrinsicAttributes & Readonly<Partial<{ selected: boolean; }> & Omit<{ selected: boolean; } & {}, "selected">>'.ts(2322)
The component looks like this:
export default defineComponent({ name: 'MyComponent', functional: true, props: { selected: { type: Boolean, default: false }, }, render () // omitted for brevity })
The type checking should allow specifying class and style attributes.
class
style
I'm using Vue 2.7 ^2.7.0-beta.5
^2.7.0-beta.5
The text was updated successfully, but these errors were encountered:
Hi, I added jsx.d.ts in my project with following code:
jsx.d.ts
declare namespace JSX { interface IntrinsicAttributes { class?: any; } }
This solved my "class" attribute problem.
Sorry, something went wrong.
Fixed by #1533
No branches or pull requests
In my template I'm rendering a Vue component and specify the class and style attribute on the tag, like so:
I get a type error, saying:
The component looks like this:
The type checking should allow specifying
class
andstyle
attributes.I'm using Vue 2.7
^2.7.0-beta.5
The text was updated successfully, but these errors were encountered: