Prop: value is of type string | number
but emit update:value only has type number which causes TS error.
Change to
update:value: string | number
error TS2322: Type '(tabName: string) => void' is not assignable to type '(value: number) => void'.
Types of parameters 'tabName' and 'value' are incompatible.
Type 'number' is not assignable to type 'string'.
Describe the bug
Prop: value is of type string | number but emit update:value only has type number which causes TS error.
Change to update:value: string | number
error TS2322: Type '(tabName: string) => void' is not assignable to type '(value: number) => void'. Types of parameters 'tabName' and 'value' are incompatible. Type 'number' is not assignable to type 'string'.
17 @update:value="onTabChange">
Reproducer
https://stackblitz.com/edit/primevue-4-ts-vite-issue-template-jg7u4u?file=README.md
PrimeVue version
4.2.2
Vue version
3.x
Language
TypeScript
Build / Runtime
Vue CLI App
Browser(s)
No response
Steps to reproduce the behavior
Add tabs component, set value=""
@update:value="funcThatTakesStringAsArgument"
const funcThatTakesStringAsArgument = (tabName: string) => console.log(tabName);
run ts check: vue-tsc --noEmit
Expected behavior
No response