Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabs: Mismatch between prop "value" and emit update:value #6825

Closed
antej85 opened this issue Nov 21, 2024 · 1 comment
Closed

Tabs: Mismatch between prop "value" and emit update:value #6825

antej85 opened this issue Nov 21, 2024 · 1 comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@antej85
Copy link

antej85 commented Nov 21, 2024

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

@antej85 antej85 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 21, 2024
@tugcekucukoglu
Copy link
Member

Fixed with: ff7d46e

@tugcekucukoglu tugcekucukoglu added this to the 4.2.3 milestone Nov 21, 2024
@tugcekucukoglu tugcekucukoglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants