framework
framework copied to clipboard
Html and Body components: class prop type error if not string
Environment
- Operating System:
Darwin - Node Version:
v16.16.0 - Nuxt Version:
3.0.0 - Nitro Version:
1.0.0 - Package Manager:
[email protected] - Builder:
vite - User Config:
modules - Runtime Modules:
@nuxtjs/[email protected],@vueuse/[email protected] - Build Modules:
-
Reproduction
https://stackblitz.com/edit/github-fbh4ex?file=app.vue
Please note: the StackBlitz version doesn't show type errors. If you have a fresh local project with the code, you will see the type error.
Describe the bug
The <Html> and <Body> components show type errors when you attempt to use anything other than a string for the class prop. Shouldn't their class prop accept arrays and objects as well?
(property) class?: string | undefined
Type '{ test: true; }' is not assignable to type 'string'.ts(2322)
components.d.ts(654, 5): The expected type comes from property 'class' which is declared here on type 'ComponentProps<DefineComponent<{ manifest: StringConstructor; version: StringConstructor; xmlns: StringConstructor; renderPriority: (StringConstructor | NumberConstructor)[]; ... 27 more ...; translate: StringConstructor; }, ... 10 more ..., { ...; }>>'
Additional context
No response
Logs
No response