Closed cawa-93 closed 3 years ago
This is expected, you can add & { [Symbol.iterator](): IterableIterator<VALUE_TYPE> }
to your type for fix.
OK. This really fixed the problem. I wonder what caused this behavior. It doesn't seem intuitive.
You should make sure the object can use with for...of
, for example:
declare let foo: Record<string, string>;
for (const item of foo) { } // TS2488
declare let bar: Record<string, string> & { [Symbol.iterator](): IterableIterator<string> };
for (const item of bar) { } // works
I found that for...in
can better to handle it, and it was fixed in vue-tsc
0.0.14. Sorry for make the confusion.
I have component:
In Runtime it works as expected. But checking the types falls with a error: