You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But it difficulty to expose some api methods which are using setup context when using composition api with tsx syntax.
import{defineComponent,ref}from'vue'exportdefaultdefineComponent({setup(){constinput=ref<HTMLElement|null>(null)// How to expose this method?functionfocus(){input.value?.focus()}retrun()=><inputref={input}/>}})
What does the proposed API look like?
import{defineComponent,ref,defineExpose}from'vue'exportdefaultdefineComponent({setup(){constinput=ref<HTMLElement|null>(null)functionfocus(){input.value?.focus()}// expose like in <script setup>defineExpose({ focus })retrun()=><inputref={input}/>}})
Maybe some important I missed?
The text was updated successfully, but these errors were encountered:
What problem does this feature solve?
When some api methods don't use setup context, it can be exposed like following:
But it difficulty to expose some api methods which are using setup context when using composition api with tsx syntax.
What does the proposed API look like?
Maybe some important I missed?
The text was updated successfully, but these errors were encountered: