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

Method resolve

packages/runtime-dom/src/apiCustomElement.ts:387–423  ·  view source on GitHub ↗
(def: InnerComponentDef, isAsync = false)

Source from the content-addressed store, hash-verified

385 this._ob.observe(this, { attributes: true })
386
387 const resolve = (def: InnerComponentDef, isAsync = false) => {
388 this._resolved = true
389 this._pendingResolve = undefined
390
391 const { props, styles } = def
392
393 // cast Number-type props set before resolve
394 let numberProps
395 if (props && !isArray(props)) {
396 for (const key in props) {
397 const opt = props[key]
398 if (opt === Number || (opt && opt.type === Number)) {
399 if (key in this._props) {
400 this._props[key] = toNumber(this._props[key])
401 }
402 ;(numberProps || (numberProps = Object.create(null)))[
403 camelize(key)
404 ] = true
405 }
406 }
407 }
408 this._numberProps = numberProps
409 this._resolveProps(def)
410
411 // apply CSS
412 if (this.shadowRoot) {
413 this._applyStyles(styles)
414 } else if (__DEV__ && styles) {
415 warn(
416 'Custom element style injection is not supported when using ' +
417 'shadowRoot: false',
418 )
419 }
420
421 // initial mount
422 this._mount(def)
423 }
424
425 const asyncDef = (this._def as ComponentOptions).__asyncLoader
426 if (asyncDef) {

Callers

nothing calls this directly

Calls 5

_resolvePropsMethod · 0.95
_applyStylesMethod · 0.95
_mountMethod · 0.95
toNumberFunction · 0.90
warnFunction · 0.90

Tested by

no test coverage detected