-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Open
Labels
need documentationNot necessarily a bug, but proper documentation is neededNot necessarily a bug, but proper documentation is neededscope: types
Description
Vue version
3.5.12
Link to minimal reproduction
https://github.com/DrWarpMan/vue-generic-bug
Steps to reproduce
The bug is described in the comments of the code.
App.vue
<script setup lang="ts">
import { h, ref } from 'vue';
import Comp from './Comp.vue';
const foo = ref<string>('foo');
// val should be of type 'string', not 'unknown'
const FunctionalComponent = () => h(Comp, {
/* unknown */ modelValue: foo.value,
['onUpdate:modelValue']: (val /* unknown */) => foo.value = val,
});
</script>
<template />
Comp.vue
<script setup lang="ts" generic="T">
defineModel<T>({required: true});
</script>
<template />
What is expected?
Render functions should have proper type based on the provided value to the generic component.
What is actually happening?
Render functions have 'unknown' type, regardless of the provided value to the generic component.
System Info
No response
Any additional comments?
Issue was moved from language-tools repo.
Metadata
Metadata
Assignees
Labels
need documentationNot necessarily a bug, but proper documentation is neededNot necessarily a bug, but proper documentation is neededscope: types