Open
Description
- I have searched the issues of this repository and believe that this is not a duplicate.
What problem does this feature solve?
(this.$refs.input as Input).focus();
results in error:
ERROR in src/views/home/home.tsx:16:28
TS2749: 'Input' refers to a value, but is being used as a type here. Did you mean 'typeof Input'?
14 | methods: {
15 | fn() {
> 16 | (this.$refs.input as Input).focus();
| ^^^^^
17 | }
18 | }
19 | });
Instead, you have to write the verbose and not-newbie-friendly code:
(this.$refs.input as InstanceType<typeof Input>).focus();
That works with vscode intellisense and type checking.
What does the proposed API look like?
(this.$refs.input as Input).focus();
should work as the old version does.