I want to custom props for every components. But In vue/jsx-runtime IntrinsicAttributes only extends ReservedProps.
The ReservedProps is a type, not a interface. So i can't use declare module to extend custom props.
// jsx.d.ts
declare module 'vue' {
interface HTMLAttributes {
vPermission?: string
vLoading?: boolean
}
// How can i customize the props of every components?
interface ReservedProps {
vPermission?: string
vLoading?: boolean
}
}
export {}
Vue version
vue3.5.10
Link to minimal reproduction
https://stackblitz.com/github/zhiyuanzmj/vue-jsx-reproduction?file=src%2FApp.tsx
Steps to reproduce
I want to custom props for every components. But In vue/jsx-runtime IntrinsicAttributes only extends ReservedProps. The ReservedProps is a type, not a interface. So i can't use declare module to extend custom props.
Just like react:
What is expected?
How about add ComponentCustomProps to extends IntrinsicAttributes .
What is actually happening?
I can't find any way to custom props.
System Info
Any additional comments?
No response