-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
TS typings of components should be more useful #3220
Labels
Comments
vuejs/rfcs#210 似乎可以期待一下这个API? |
可以这样,针对组件 Input 设计一个 InputInterface 的接口 interface InputInterface {
//这里对于 需要公开外部处理的methods 添加 方法签名,如
setValue(value: string | number, callback?: Function) ;
focus();
} 之后在调用时 defineComponent({
setup(){
const input =ref<InputInterface>(null);
return { input }
},
methods: {
fn() {
this.input.focus();
}
}
}) <a-input ref="input" /> |
看上去应该可以 |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days |
Unstale please |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What problem does this feature solve?
results in error:
Instead, you have to write the verbose and not-newbie-friendly code:
That works with vscode intellisense and type checking.
What does the proposed API look like?
should work as the old version does.
The text was updated successfully, but these errors were encountered: