(instance: ComponentInternalInstance)
| 518 | export let shouldCacheAccess = true |
| 519 | |
| 520 | export function applyOptions(instance: ComponentInternalInstance): void { |
| 521 | const options = resolveMergedOptions(instance) |
| 522 | const publicThis = instance.proxy! as any |
| 523 | const ctx = instance.ctx |
| 524 | |
| 525 | // do not cache property access on public proxy during state initialization |
| 526 | shouldCacheAccess = false |
| 527 | |
| 528 | // call beforeCreate first before accessing other options since |
| 529 | // the hook may mutate resolved options (#2791) |
| 530 | if (options.beforeCreate) { |
| 531 | callHook(options.beforeCreate, instance, LifecycleHooks.BEFORE_CREATE) |
| 532 | } |
| 533 | |
| 534 | const { |
| 535 | // state |
| 536 | data: dataOptions, |
| 537 | computed: computedOptions, |
| 538 | methods, |
| 539 | watch: watchOptions, |
| 540 | provide: provideOptions, |
| 541 | inject: injectOptions, |
| 542 | // lifecycle |
| 543 | created, |
| 544 | beforeMount, |
| 545 | mounted, |
| 546 | beforeUpdate, |
| 547 | updated, |
| 548 | activated, |
| 549 | deactivated, |
| 550 | beforeDestroy, |
| 551 | beforeUnmount, |
| 552 | destroyed, |
| 553 | unmounted, |
| 554 | render, |
| 555 | renderTracked, |
| 556 | renderTriggered, |
| 557 | errorCaptured, |
| 558 | serverPrefetch, |
| 559 | // public API |
| 560 | expose, |
| 561 | inheritAttrs, |
| 562 | // assets |
| 563 | components, |
| 564 | directives, |
| 565 | filters, |
| 566 | } = options |
| 567 | |
| 568 | const checkDuplicateProperties = __DEV__ ? createDuplicateChecker() : null |
| 569 | |
| 570 | if (__DEV__) { |
| 571 | const [propsOptions] = instance.propsOptions |
| 572 | if (propsOptions) { |
| 573 | for (const key in propsOptions) { |
| 574 | checkDuplicateProperties!(OptionTypes.PROPS, key) |
| 575 | } |
| 576 | } |
| 577 | } |
no test coverage detected