Open CarterLi opened 3 years ago
https://github.com/vuejs/rfcs/pull/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
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.