Closed
Description
Vue version
3.3.8
Link to minimal reproduction
Steps to reproduce
Create a Component with a defineModel that got multiple types
<script setup lang="ts">
const modelValue = defineModel<string | number | null | boolean>()
</script>
<template>
<input type="text" v-model="modelValue">
</template>
Use the component.
<script setup lang="ts">
import { ref } from 'vue'
import Comp from "./Comp.vue"
const msg = ref('Hello World!')
</script>
<template>
<h1>{{ msg }}</h1>
<Comp v-model="msg" />
</template>
Observe warning:
What is expected?
Expected is that the component accepts the string without any errors.
What is actually happening?
The component throws a warning that it got passed a String instead a Boolean
System Info
No response
Any additional comments?
Im now defineModel is an experimental feature , but i guess the user would expect that it works as the usual prop type definition that throws no warning.