MCPcopy Create free account
hub / github.com/TruthHun/BookStack / initMixin

Function initMixin

static/vuejs/vue.common.js:3714–3771  ·  view source on GitHub ↗
(Vue)

Source from the content-addressed store, hash-verified

3712var uid = 0;
3713
3714function initMixin (Vue) {
3715 Vue.prototype._init = function (options) {
3716 var vm = this;
3717 // a uid
3718 vm._uid = uid++;
3719
3720 var startTag, endTag;
3721 /* istanbul ignore if */
3722 if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
3723 startTag = "vue-perf-init:" + (vm._uid);
3724 endTag = "vue-perf-end:" + (vm._uid);
3725 mark(startTag);
3726 }
3727
3728 // a flag to avoid this being observed
3729 vm._isVue = true;
3730 // merge options
3731 if (options && options._isComponent) {
3732 // optimize internal component instantiation
3733 // since dynamic options merging is pretty slow, and none of the
3734 // internal component options needs special treatment.
3735 initInternalComponent(vm, options);
3736 } else {
3737 vm.$options = mergeOptions(
3738 resolveConstructorOptions(vm.constructor),
3739 options || {},
3740 vm
3741 );
3742 }
3743 /* istanbul ignore else */
3744 if (process.env.NODE_ENV !== 'production') {
3745 initProxy(vm);
3746 } else {
3747 vm._renderProxy = vm;
3748 }
3749 // expose real self
3750 vm._self = vm;
3751 initLifecycle(vm);
3752 initEvents(vm);
3753 initRender(vm);
3754 callHook(vm, 'beforeCreate');
3755 initInjections(vm); // resolve injections before data/props
3756 initState(vm);
3757 initProvide(vm); // resolve provide after data/props
3758 callHook(vm, 'created');
3759
3760 /* istanbul ignore if */
3761 if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
3762 vm._name = formatComponentName(vm, false);
3763 mark(endTag);
3764 measure(((vm._name) + " init"), startTag, endTag);
3765 }
3766
3767 if (vm.$options.el) {
3768 vm.$mount(vm.$options.el);
3769 }
3770 };
3771}

Callers 1

vue.common.jsFile · 0.70

Calls 10

initInternalComponentFunction · 0.70
mergeOptionsFunction · 0.70
initLifecycleFunction · 0.70
initEventsFunction · 0.70
initRenderFunction · 0.70
callHookFunction · 0.70
initInjectionsFunction · 0.70
initStateFunction · 0.70
initProvideFunction · 0.70

Tested by

no test coverage detected