Hover over attrs: the type will be Data instead of ButtonHTMLAttributes
const attrs = useAttrs();
Run npm run check: You will see that
What is expected?
The type of the fallthrough attributes should be Data when there is no v-bind="$attrs" assigned to an element. But when it is assigned, it should be of the assigned element's attributes type.
What is actually happening?
The type of the fallthrough attributes always is Data, both on useAttrs and $attrs.
Vue - Official extension or vue-tsc version
2.1.10
VSCode version
1.95.3
Vue version
3.5.12
TypeScript version
5.6.3
System Info
No response
package.json dependencies
Steps to reproduce
attrs
: the type will beData
instead ofButtonHTMLAttributes
npm run check
: You will see thatWhat is expected?
The type of the fallthrough attributes should be
Data
when there is nov-bind="$attrs"
assigned to an element. But when it is assigned, it should be of the assigned element's attributes type.What is actually happening?
The type of the fallthrough attributes always is
Data
, both onuseAttrs
and$attrs
.Link to minimal reproduction
https://stackblitz.com/edit/vue3-vite-typescript-starter-aahszk?file=src%2Fcomponents%2FVButton.vue
Any additional comments?
No response