9 lines
273 B
TypeScript
9 lines
273 B
TypeScript
import type { ComponentPublicInstance } from 'vue'
|
|
import { getCurrentInstance } from 'vue'
|
|
|
|
export function useExpose(apis: Record<string, any>) {
|
|
const instance = getCurrentInstance()
|
|
if (instance)
|
|
Object.assign(instance.proxy as ComponentPublicInstance, apis)
|
|
}
|