How use “expose” Function Signature “defineComponent” expose怎么实现类型提示 #13325
Unanswered
ZhangGuangHuiCoder
asked this question in
Help/Questions
Replies: 1 comment
-
import { ref, h } from 'vue'
export type CompInst = {
fn: () => void
}
const Comp = defineComponent(
(props,{expose}) => {
// use Composition API here like in <script setup>
const count = ref(0)
expose({ fn: () => null })
return () => h('div', count.value)
},
{
props: {},
emits: {},
expose:{}???
},
)
const compRef = useTemplateRef<CompInst>('comp') 目前在defineComponent没找到啥办法,只有这样给个类型 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
expose 没有类型提示
Beta Was this translation helpful? Give feedback.
All reactions