vue3+ts slots、emit、attrs、expose 是什么类型?

淡若清风过
  • 76
export default {
  setup(props, { attrs, slots, emit, expose }) {
    ...
  }
}
回复
阅读 370
1 个回答
zangeci
  • 10.3k
✓ 已被采纳

https://v3.cn.vuejs.org/api/c...

{SetupContext} context

interface SetupContext {
  attrs: Data
  slots: Slots
  emit: (event: string, ...args: unknown[]) => void
  expose: (exposed?: Record<string, any>) => void
宣传栏