packages/weex-vue-framework/factory.js
function initVirtualComponent (options) {
  if ( options === void 0 ) options = {};

  var vm = this;
  var componentId = options.componentId;

  // virtual component uid
  vm._uid = "virtual-component-" + (uid$2++);

  // a flag to avoid this being observed
  vm._isVue = true;
  // merge options
  if (options && options._isComponent) {
    // optimize internal component instantiation
    // since dynamic options merging is pretty slow, and none of the
    // internal component options needs special treatment.
    initInternalComponent(vm, options);
  } else {
    vm.$options = mergeOptions(
      resolveConstructorOptions(vm.constructor),
      options || {},
      vm
    );
  }

  /* istanbul ignore else */
  if (process.env.NODE_ENV !== 'production') {
    initProxy(vm);
  } else {
    vm._renderProxy = vm;
  }

  vm._self = vm;
  initLifecycle(vm);
  initEvents(vm);
  initRender(vm);
  callHook(vm, 'beforeCreate');
  initInjections(vm); // resolve injections before data/props
  initState(vm);
  initProvide(vm); // resolve provide after data/props
  callHook(vm, 'created');

  // send initial data to native
  var data = vm.$options.data;
  var params = typeof data === 'function'
    ? getData(data, vm)
    : data || {};
  if (isPlainObject(params)) {
    updateComponentData(componentId, params);
  }

  registerComponentHook(componentId, 'lifecycle', 'attach', function () {
    callHook(vm, 'beforeMount');

    var updateComponent = function () {
      vm._update(vm._vnode, false);
    };
    new Watcher(vm, updateComponent, noop, null, true);

    vm._isMounted = true;
    callHook(vm, 'mounted');
  });

  registerComponentHook(componentId, 'lifecycle', 'detach', function () {
    vm.$destroy();
  });
}
function initVirtualComponent (options) {
  if ( options === void 0 ) options = {};

  var vm = this;
  var componentId = options.componentId;

  // virtual component uid
  vm._uid = "virtual-component-" + (uid$2++);

  // a flag to avoid this being observed
  vm._isVue = true;
  // merge options
  if (options && options._isComponent) {
    // optimize internal component instantiation
    // since dynamic options merging is pretty slow, and none of the
    // internal component options needs special treatment.
    initInternalComponent(vm, options);
  } else {
    vm.$options = mergeOptions(
      resolveConstructorOptions(vm.constructor),
      options || {},
      vm
    );
  }

  /* istanbul ignore else */
  if (process.env.NODE_ENV !== 'production') {
    initProxy(vm);
  } else {
    vm._renderProxy = vm;
  }

  vm._self = vm;
  initLifecycle(vm);
  initEvents(vm);
  initRender(vm);
  callHook(vm, 'beforeCreate');
  initInjections(vm); // resolve injections before data/props
  initState(vm);
  initProvide(vm); // resolve provide after data/props
  callHook(vm, 'created');

  // send initial data to native
  var data = vm.$options.data;
  var params = typeof data === 'function'
    ? getData(data, vm)
    : data || {};
  if (isPlainObject(params)) {
    updateComponentData(componentId, params);
  }

  registerComponentHook(componentId, 'lifecycle', 'attach', function () {
    callHook(vm, 'beforeMount');

    var updateComponent = function () {
      vm._update(vm._vnode, false);
    };
    new Watcher(vm, updateComponent, noop, null, true);

    vm._isMounted = true;
    callHook(vm, 'mounted');
  });

  registerComponentHook(componentId, 'lifecycle', 'detach', function () {
    vm.$destroy();
  });
}
function initVirtualComponent ( options ) { if ( options === void 0 ) options = { } ; var vm = this ; var componentId = options . componentId ; // virtual component uid vm . _uid = "virtual-component-" + ( uid$2 ++ ) ; // a flag to avoid this being observed vm . _isVue = true ; // merge options if ( options && options . _isComponent ) { // optimize internal component instantiation // since dynamic options merging is pretty slow, and none of the // internal component options needs special treatment. initInternalComponent ( vm , options ) ; } else { vm . $options = mergeOptions ( resolveConstructorOptions ( vm . constructor ) , options || { } , vm ) ; } /* istanbul ignore else */ if ( process . env . NODE_ENV !== 'production' ) { initProxy ( vm ) ; } else { vm . _renderProxy = vm ; } vm . _self = vm ; initLifecycle ( vm ) ; initEvents ( vm ) ; initRender ( vm ) ; callHook ( vm , 'beforeCreate' ) ; initInjections ( vm ) ; // resolve injections before data/props initState ( vm ) ; initProvide ( vm ) ; // resolve provide after data/props callHook ( vm , 'created' ) ; // send initial data to native var data = vm . $options . data ; var params = typeof data === 'function' ? getData ( data , vm ) : data || { } ; if ( isPlainObject ( params ) ) { updateComponentData ( componentId , params ) ; } registerComponentHook ( componentId , 'lifecycle' , 'attach' , function ( ) { callHook ( vm , 'beforeMount' ) ; var updateComponent = function ( ) { vm . _update ( vm . _vnode , false ) ; } ; new Watcher ( vm , updateComponent , noop , null , true ) ; vm . _isMounted = true ; callHook ( vm , 'mounted' ) ; } ) ; registerComponentHook ( componentId , 'lifecycle' , 'detach' , function ( ) { vm . $destroy ( ) ; } ) ; }
override Vue.prototype._init
override Vue . prototype . _init