MCPcopy
hub / github.com/vuejs/core / defineComponent

Function defineComponent

packages/runtime-core/src/apiDefineComponent.ts:305–315  ·  view source on GitHub ↗
(
  options: unknown,
  extraOptions?: ComponentOptions,
)

Source from the content-addressed store, hash-verified

303// implementation, close to no-op
304/*@__NO_SIDE_EFFECTS__*/
305export function defineComponent(
306 options: unknown,
307 extraOptions?: ComponentOptions,
308) {
309 return isFunction(options)
310 ? // #8236: extend call and options.name access are considered side-effects
311 // by Rollup, so we have to wrap it in a pure-annotated IIFE.
312 /*@__PURE__*/ (() =>
313 extend({ name: options.name }, extraOptions, { setup: options }))()
314 : options
315}

Callers 15

defineCustomElementFunction · 0.90
vShow.spec.tsFile · 0.90
defineAsyncComponentFunction · 0.90
apiExpose.spec.tsFile · 0.90
computed.spec.tsFile · 0.85
testRenderFunction · 0.85
ssrWatch.spec.tsFile · 0.85
nodeOps.spec.tsFile · 0.85
vModel.spec.tsFile · 0.85

Calls 1

isFunctionFunction · 0.90

Tested by 4

testRenderFunction · 0.68
makeCompFunction · 0.68
runSharedTestsFunction · 0.68
factoryFunction · 0.68