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

Type check error when using local name different from prop name with runtime api #4649

Closed
KazariEX opened this issue Aug 5, 2024 · 0 comments · Fixed by #4650
Closed

Type check error when using local name different from prop name with runtime api #4649

KazariEX opened this issue Aug 5, 2024 · 0 comments · Fixed by #4650
Labels
bug Something isn't working ❗ p4-important

Comments

@KazariEX
Copy link
Collaborator

KazariEX commented Aug 5, 2024

Vue - Official extension or vue-tsc version

2.0.28

VSCode version

1.92.0-Insider

Vue version

3.5.0-alpha.5

TypeScript version

5.5.4

System Info

No response

Steps to reproduce

<script lang="ts" setup>
import Child from './component.vue';

const model = '1';
const foo = '1';
const bar = '1';
</script>

<template>
    <Child
        v-model="model"
        v-model:foo="foo"
        v-model:bar="bar"
    />
</template>
<script lang="ts" setup>
const modelAlias = defineModel({
    type: Number,
    required: true
});
const fooAlias = defineModel('foo', {
    type: Number,
    default: 1
});
const barAlias = defineModel('bar', {
    default: 1
});
</script>

What is expected?

Correct type inference.

What is actually happening?

All props got any type.

Link to minimal reproduction

No response

Any additional comments?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ❗ p4-important
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants