(def: InnerComponentDef, isAsync = false)
| 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) { |
nothing calls this directly
no test coverage detected