wip: expose getCurrentInstance()

This commit is contained in:
Evan You 2019-06-20 15:25:10 +08:00
parent 8eb20eede9
commit 9c0f820a8e
2 changed files with 8 additions and 1 deletions

View File

@ -218,6 +218,9 @@ export function createComponentInstance(
export let currentInstance: ComponentInstance | null = null
export const getCurrentInstance: () => ComponentInstance | null = () =>
currentInstance
export function setupStatefulComponent(instance: ComponentInstance) {
const Component = instance.type as ComponentOptions
// 1. create render proxy

View File

@ -10,7 +10,11 @@ export {
} from './vnode'
export { nextTick } from './scheduler'
export { createComponent, FunctionalComponent } from './component'
export {
createComponent,
getCurrentInstance,
FunctionalComponent
} from './component'
export { createRenderer, RendererOptions } from './createRenderer'
export { Slot, Slots } from './componentSlots'
export { PropType, ComponentPropsOptions } from './componentProps'