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

Function initMixin

static/vuejs/vue.esm.js:3712–3769  ·  view source on GitHub ↗
(Vue)

Source from the content-addressed store, hash-verified

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

Callers 1

vue.esm.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