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
Vue.prototype.$attrs should be type Record<string, any> and not Record<string, string>.
Since 2.4.0, vm.$attrs has contained extracted bindings not recognized as props. The type of these values is unknown.
Steps to reproduce
Take the following component:
newVue({data: function(){return{count: 0}},mounted(){letsomeFunc=this.$attrs.someBoundAttrasFunction// Type 'string' cannot be converted to type 'Function'},template: ` <button v-on:click="count++" :someBoundAttr="() => count"> You clicked me {{ count }} times. </button>`})
Notice the error in TypeScript checking:
Type 'string' cannot be converted to type 'Function'
Version
2.6.10
What is expected?
Vue.prototype.$attrs
should be typeRecord<string, any>
and notRecord<string, string>
.Since
2.4.0
,vm.$attrs
has contained extracted bindings not recognized as props. The type of these values is unknown.Steps to reproduce
Take the following component:
Notice the error in TypeScript checking:
What is actually happening?
...
Reproduction link
http://www.typescriptlang.org/play/
The text was updated successfully, but these errors were encountered: