vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.87k stars 400 forks source link

use Partial in defineProps without use toRefs, type will be "unknown" #4732

Closed Kanade-Lu closed 2 months ago

Kanade-Lu commented 2 months ago

Vue - Official extension or vue-tsc version

v2.0.28

VSCode version

1.92.1 (Universal)

Vue version

v3.4.38

TypeScript version

latest

System Info

No response

Steps to reproduce

interface IGroupDetail { created_at: string; } const props = defineProps<{ groupDetail: Partial }>()

// const { groupDetail } = toRefs(props) // Comment this code,groupDetail in template will unknown

What is expected?

groupDetail in template type should be IGroupDetail

What is actually happening?

groupDetail in template will unknown

Link to minimal reproduction

https://play.vuejs.org/#eNp9ks1u2zAMx1+F0yUpkNkYusOQORn2UWzdYQu6AbsIKAybdtTKkiDRTgDDb7BH2jvtFUbLTePDWp8s8k/yx49evHcu6VoUa5GFwitHEJBaBzo39UYKClJspVGNs56gB4/VCsjeYBVggMrbBhYcvpCGRYbQV3mBcP3Z29Z9QsqVhl4a4K/wmBOWtzmtIZBXpn4rzSBNYU0gcN66ABsosVIGd+Mrewisz7nWsMs9qVxn8wrMN2yXFyNCmsKUr5+HMenmAXoZC10ACz/apkFDQHsVOKrEv39+z4OUAcLGaaaGg9IaWnNv7MHAWGiq0oSaM/NMlosvqLWFX9br8sWCWbJ0GifD8eOUiF8A2f7Vtu9j8DBkKb+itVTdFoAdM4h3yXlsUTyKoloZ1xJ0LxsG17woziYFpOzM0lk1seIVMmyl6uQuWMN7jmOVorCNUxr9d0eKm5FifdqUFDn3cvgabeRbXJ3sxR6L+//Y78JxtEmx8xjQdyjFo49yXyNN7qsf3/DI/49Opm81q59x3mCwuh0ZJ9mH1pSMPdNF2ut4oXxVP8PVkdCEU1Mj6Kgcol4Kvlbe/JOtn3Evk9cxjq+Lp3jboR9z8gDZkVy+EcM/BiIZsg==

Any additional comments?

No response

Kanade-Lu commented 2 months ago

image

seems to be $props will lose type