You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to wrap InputText in a custom component like so:
import type { InputTextProps } from 'primevue/inputtext'
interface Props extends InputTextProps {
icon: string
}
const props = defineProps<Props>()
leads to:
> [@vue/compiler-sfc] Failed to resolve extends base type.
If this previously worked in 3.2, you can instruct the compiler to ignore this extend by adding /* @vue-ignore */ before it, for example:
interface Props extends /* @vue-ignore */ Base {}
Note: both in 3.2 or with the ignore, the properties in the base type are treated as fallthrough attrs at runtime.
/my/path/CustomInputGroup.vue
21 |
22 |
23 | interface Props extends InputTextProps {
| ^^^^^^^^^^^^^^
24 | icon: string
25 | }
There has been an issue for another bug where this problem was also talked about:
Describe the bug
Trying to wrap
InputText
in a custom component like so:leads to:
There has been an issue for another bug where this problem was also talked about:
#5480
That issue has been closed around a month ago after the extend had been removed from
InputTextProps
: d397280#diff-fd5388a3530408f2bf6b8999987f26337bc58eaa03e12e20dcf0dbf3e9d4e656A new
extends
was added a few days later though:442026d#diff-fd5388a3530408f2bf6b8999987f26337bc58eaa03e12e20dcf0dbf3e9d4e656
Is there another way to wrap components and this one is not the intended way?
Reproducer
https://stackblitz.com/edit/primevue-4-ts-vite-issue-template-3ecdeusa?file=src%2Fcomponents%2FCustomInputGroup.vue
PrimeVue version
4.2.5
Vue version
3.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
No response
Steps to reproduce the behavior
Define interface that extends
InputTextProps
. Breaks. Also passingInputTextProps
directly intodefineProps
breaks.Expected behavior
InputTextProps
can be reused to wrap and extend the existing component(s)The text was updated successfully, but these errors were encountered: