-
-
Notifications
You must be signed in to change notification settings - Fork 421
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
Fallthrough attributes are recognized as errors #2671
Comments
I can't reproduce this problem, please provide minimal reproduction. |
Here is a minimal reproduction example, run |
This seems to be expected behavior of jsx, can you remove |
That solves the problem, thanks a lot! |
// Inputty.tsx
{
setup() {
return () => <input />;
},
} There is no [email protected] Name: Vue Language Features (Volar) Name: TypeScript Vue Plugin (Volar) |
solved by /**
* for vue components
* https://github.com/vuejs/language-tools/issues/1077
*/
declare module '@vue/runtime-core' {
interface AllowedComponentProps {
[key: string]: any;
}
}
export {} thanks. but may be there is some better way for ths issue. |
I have add this code, but still get error |
also custom directive show error after upgrade to 1.6 |
are you sure not missing `export {}`在 2023年4月27日,下午9:56,progame ***@***.***> 写道:
/**
* for vue components
* #1077
*/
declare module ***@***.***/runtime-core' {
interface AllowedComponentProps {
[key: string]: any;
}
}
export {}
I have add this code, but still not works
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Should this be reopened? I'm still experiencing it in Also to mention that it started in v1.4.1 of // App.tsx
import ButtonLink from './components/ButtonLink.vue'
const App =
<ButtonLink text="My Link" title="My Title" />
export default App; <script setup lang="ts">
// ./components/ButtonLink.vue
defineProps<{
text: string
}>()
</script>
<template>
<button title="Button Title">
{{ text }}
</button>
</template>
|
@romansp thanks for the repro case, but I think it is expected behavior, you can reproduce it in regular ts code. import { defineComponent } from 'vue';
const ButtonLink = defineComponent({
props: { text: { type: String, required: true } }
});
const App =
<ButtonLink text="My Link" title="My Title" />
export default App; |
@johnsoncodehk Wow, okay. Odd that it used to work correctly in 1.4.0 and before. Looks like template type check became more strict? So is there a recommended solution for this problem while still keeping type-checks for component-defined props? |
Merging IntrinsicAttributes declaration can solve it namespace JSX {
export interface IntrinsicAttributes {
[name: string]: any
}
} |
now I have to use any object to pass fullthrough attribute, otherwise it can't be compiled: const tag = ( |
Volar plugin version
v1.4.2
Fallthrough attributes are recognized as errors (
title
attribute in the following code):vscode error:
screenshot:
The text was updated successfully, but these errors were encountered: