4cd4fd28
郭伟龙
feat: 初始化项目
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import { createElement } from '../core/vdom/create-element'
import { currentInstance } from './currentInstance'
import { warn } from 'core/util'
/**
* @internal this function needs manual public type declaration because it relies
* on previously manually authored types from Vue 2
*/
export function h(type: any, props?: any, children?: any) {
if (!currentInstance) {
__DEV__ &&
warn(
`globally imported h() can only be invoked when there is an active ` +
`component instance, e.g. synchronously in a component's render or setup function.`
)
}
return createElement(currentInstance!, type, props, children, 2, true)
}
|