MCPcopy
hub / github.com/vuejs/composition-api / createElement

Function createElement

src/apis/createElement.ts:36–51  ·  view source on GitHub ↗
(this, ...args: any)

Source from the content-addressed store, hash-verified

34let fallbackCreateElement: CreateElement
35
36export const createElement: H = function createElement(this, ...args: any) {
37 const instance = this?.proxy || getCurrentInstance()?.proxy
38 if (!instance) {
39 __DEV__ &&
40 warn('`createElement()` has been called outside of render function.')
41 if (!fallbackCreateElement) {
42 fallbackCreateElement = defineComponentInstance(
43 getVueConstructor()
44 ).$createElement
45 }
46
47 return fallbackCreateElement.apply(fallbackCreateElement, args)
48 }
49
50 return instance.$createElement.apply(instance, args)
51}

Callers 1

renderVnodeFunction · 0.85

Calls 4

getCurrentInstanceFunction · 0.90
warnFunction · 0.90
defineComponentInstanceFunction · 0.90
getVueConstructorFunction · 0.90

Tested by 1

renderVnodeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…