-
-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v-for 多个类型推导为 item: unknown #4812
Labels
Comments
const infos = ref<Info[]>([]); You need to convert Or render separately: <template v-if="Array.isArray(data)">
<div v-for="item in data" :key="item.id">{{ item.id }}</div>
</template>
<template v-else>
<div v-for="(val, key) in data" :key="val.id">{{ val.id }}</div>
</template> |
|
This should be in the scope of language tools and how |
@wxwebfeng upgrading to v2.1.10 fixed my issue. is yours resolved? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Vue version
3.5.0
Link to minimal reproduction
https://play.vuejs.org/#eNp9U81u00AQfpVhL0lRyH96CE4kQJUIohQBEodsDq69Tja1d63ddUjlWkICqRckroCExIVzX6CoL0NLeAvGayckEvRizXzzzef525Q8iOP6ImGkTxztKR4b0MwkMYSumA4oMZqSIRU8iqUykIIUhzIRhvmQQaBkBBVMrtzfYigW1PDjeoYv2A6LCqRhrgpcj8HIsAhSKgC43weRRMdMwRloo7iYUpHtcEUgj47nBX18wk77JW/StzqWbk7jgvmUawMDGxhPqPCkQD/SU8SwuGrlMQtDCa+lCv07lT0qGg1YXX3+ff7h+uPF6t2Pm08XECsZa/h5+W11dX7z9fuvL++v317CWst3jVuIOZv/na2LHFbHExSFfI6jvIOFG1arezAYFuUDFCLYMWocumZWD0IpVdWayhW+jJB+F1pNK4PzCaCas4eDHuytRcBWUUfxhKHOBgUwfUjzkbZaWW0LbZdwu70Dd0q408ERFlhpZMBCzf7zv7FN6nazmjV6vdLY389w5BuVrAadZjNvxGkU54XHhA6uJg5dw9ADcGatYZraDWWZ00DPoj5fwOJeIBWeIc+PhQtbAyXQxxMo0Tr3EcD80skVMBMlnMbWX0gNTxkHH/Bpfa6lwHu3jVHiySjmIVNHseG4GEpwIEUHlLh4KG+eWMyohJVzw5wZ807+gc/1Mscoea6Yxs0zSjYx46opM0X44OUztkR7E4ykn4TIviX4gmkZJnmNBe1hInwse4tnqx3Zd4hP45U+WBom9LqpvNBiJUXf+CIf3dL633I79a7Nw0dGsj/zRmUR
Steps to reproduce
将v-for 的类型 设置为 数组对象 或者 对象嵌套 对象, 出现 类型为 unknown 情况
What is expected?
期望 能够 推断出其类型 , 就是上面用例中的 Item
What is actually happening?
其实给出了 类型为 unknown
System Info
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: