Type UnwrapRefSimple<T>[] is not assignable to type T[] #9619
Closed
Alixhan
started this conversation in
General Discussions
Replies: 1 comment 1 reply
-
If you have constrained the variable types, you can omit passing generics when using const data: Ref<T[]> = ref([]) // success
const list: Ref<T[]> = ref<T[]>([]) // error |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
ts的泛型组件类型推导,ref函数返回的是 Ref<UnwrapRefSimple<T []>> 而不是 Ref<T []>,这写泛型组件太难受了啊

Beta Was this translation helpful? Give feedback.
All reactions