ref<SomeType>(value) not pass vue-tsc validation. Why? #12970
Unanswered
GoodDayForSurf
asked this question in
Help/Questions
Replies: 1 comment 1 reply
-
It is working fine on my side using latest Which version of |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi.
I came across a strange error in vue-tsc validation of this code:
This code doesn't pass vue-tsc validation, I get an error:
Without using ref() (directly setting properties as items) everything is ok.
Errors occur only if
ref<Item[]>(items)
is used. But ifref(items)
is usedthere is second case:
for interface:
vue-tsc checking will be OK only if items have the same set of properties.
if itmes = [{ id: 1 }, { id: 2, flag: true }] error appears:
Check by calling
npx vue-tsc --noEmit --project tsconfig.vue-check.json
tsconfig.vue-check.json is:
Is it bug or feature?
Beta Was this translation helpful? Give feedback.
All reactions