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
This seems to be a typescript issue rather than a vue issue, modelValue does not have the correct type, which causes typescript to not infer it correctly, see the example playground
I replicated desired behavior using a function in file example.ts in this Playgournd.
Both function and Vue component are using the same type for props and yet, their behavior is different.
It seems my first assumption about map returning unknown was wrong though, that is not the cause.
Vue version
3.4.19
Link to minimal reproduction
https://play.vuejs.org/#eNqNU8Fu2zAM/RVCFydA4CxrL/OcDNuQQ3fois3YJQoG12YyZbYkSHKWIMi/j5Jitx22rjeRjxQfyccTe691uu+QZSy3lRHagUXXaWhKuZ1z5ixnCy5Fq5Vx8FG1GjZGtZCkU2/41IRLLt1RIyylE+4IczhxCSDqDGTX3qN5601ZtpiBdUbILTnOPqtS0jpAnybQUuLKR55C6mxySUnKBM6TB+D1ANw/Ba4GoHoKXA9AHYE12NIJu/FFI+nVmjjl0zgCapgMh61uSodkAeSh9UxpJ4gzDaYnzRlkbanJMxrDfAFJ7DAJflVj861sOiR4Rp7pi/8KruPLfsynj6iyCe2M5roR23RnlaTFhm1wVlFV0aD5HOtylsU9eaxsGvXrU/A502GYXcj5gdXPv/h39uB9nN0ZtGj2yNmAudJs0UV4+fUWD/QeQGqgayj6GfALWtV0nmMM+9DJmmg/igtsb4IkaTCFXR4cSts35Yn6yKgAzkiifuD/av2B7lV6HfJInDTFXt7PXQZsUaIRFZnFBMJewrmEa7hVN3KDJi8WXtjFelUAtYuytlDKI7yDV0AHgns0Xnv9MWijtL+EGjdC4p238sD1IpcMitU6dEZKyeAiFPIGrQQKER2Ukg1Mgrkg+LwYjf+j91rsw4Nu6NTXTqnkKBD0r3G6U0KOkgkkYzjT1ChrGtP+VOR3atLvh2ZJQ05nb9j5N8Eidug=
Steps to reproduce
App.vue
code on line 19.What is expected?
Return type of
map
prop should be string.What is actually happening?
Return type of
map
prop is unknown when argument is present.System Info
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: