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

Function initMixin

static/vuejs/vue.runtime.common.js:3710–3767  ·  view source on GitHub ↗
(Vue)

Source from the content-addressed store, hash-verified

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

Callers 1

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