You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
HassanDomeDenea
changed the title
defineModel resolved to T | Undefined despite setting a type
typescript error in defineModel resolving it to T | Undefined despite setting a type
Sep 16, 2024
Vue version
3.5.6
Link to minimal reproduction
https://play.vuejs.org/#eNp9kV1LwzAUhv9KzE07mC1Or0Y3URmo4AcqeJOb2p52nWkS8lEHpf/dk5TNDWR3yXmfE55z0tMbpZLOAZ3TzBS6UZYYsE4Rnot6wag1jC6ZaFoltSU90VCRgVRatiTCtogJJgopjCWtqcnC53F0D5xL8ik1L8+iyREyQ6aEqhHwJEvgmbG6EfUyRsozkkPCZR17Muly7uA6Me5rpOIoiSbhuSwdXdEMLxZaxXMLeCMkW18s+z7YDEOW4u24OjsqN0I5S7rz1svguAgwSlIMs/TgWTrFRaBf1dTJxkiB2+p9P6OFbFXDQb8o26A/o3MSEp/luIWfx1Cz2sF0Vy/WUHz/U9+Yra8x+qrBgO6A0X1mc12DHePV+zNs8bwP0d5xpE+Eb4C7dd5xxG6dKFH7gAu2D+GfcdcfZrW1IMxuKC/qySHwjOLf350Y/U/3MrkKfUwMdPgFIezO1Q==
Steps to reproduce
bun create vue@latest
and following the steps, and update vue to 3.5.6.src/components/HelloWorld.vue
, adding this lineconst msg2 = defineModel<string>()
to the last line of setup scriptconsole.log(msg2.value?.substring(0, 1))
What is expected?
What is actually happening?
substring
is highlighted red causing type errorRef<T | undefined>
, and when using it inside the template, msg2 type isT | undefined
System Info
No response
Any additional comments?
The expected outcome is occurring in version [email protected]
The text was updated successfully, but these errors were encountered: