packages/weex-vue-framework/factory.js
function resolveVirtualComponent (vnode) {
  var BaseCtor = vnode.componentOptions.Ctor;
  var VirtualComponent = BaseCtor.extend({});
  var cid = VirtualComponent.cid;
  VirtualComponent.prototype._init = initVirtualComponent;
  VirtualComponent.prototype._update = updateVirtualComponent;

  vnode.componentOptions.Ctor = BaseCtor.extend({
    beforeCreate: function beforeCreate () {
      // const vm: Component = this

      // TODO: listen on all events and dispatch them to the
      // corresponding virtual components according to the componentId.
      // vm._virtualComponents = {}
      var createVirtualComponent = function (componentId, propsData) {
        // create virtual component
        // const subVm =
        new VirtualComponent({
          componentId: componentId,
          propsData: propsData
        });
        // if (vm._virtualComponents) {
        //   vm._virtualComponents[componentId] = subVm
        // }
      };

      registerComponentHook(cid, 'lifecycle', 'create', createVirtualComponent);
    },
    beforeDestroy: function beforeDestroy () {
      delete this._virtualComponents;
    }
  });
}
function resolveVirtualComponent (vnode) {
  var BaseCtor = vnode.componentOptions.Ctor;
  var VirtualComponent = BaseCtor.extend({});
  var cid = VirtualComponent.cid;
  VirtualComponent.prototype._init = initVirtualComponent;
  VirtualComponent.prototype._update = updateVirtualComponent;

  vnode.componentOptions.Ctor = BaseCtor.extend({
    beforeCreate: function beforeCreate () {
      // const vm: Component = this

      // TODO: listen on all events and dispatch them to the
      // corresponding virtual components according to the componentId.
      // vm._virtualComponents = {}
      var createVirtualComponent = function (componentId, propsData) {
        // create virtual component
        // const subVm =
        new VirtualComponent({
          componentId: componentId,
          propsData: propsData
        });
        // if (vm._virtualComponents) {
        //   vm._virtualComponents[componentId] = subVm
        // }
      };

      registerComponentHook(cid, 'lifecycle', 'create', createVirtualComponent);
    },
    beforeDestroy: function beforeDestroy () {
      delete this._virtualComponents;
    }
  });
}
function resolveVirtualComponent ( vnode ) { var BaseCtor = vnode . componentOptions . Ctor ; var VirtualComponent = BaseCtor . extend ( { } ) ; var cid = VirtualComponent . cid ; VirtualComponent . prototype . _init = initVirtualComponent ; VirtualComponent . prototype . _update = updateVirtualComponent ; vnode . componentOptions . Ctor = BaseCtor . extend ( { beforeCreate : function beforeCreate ( ) { // const vm: Component = this // TODO: listen on all events and dispatch them to the // corresponding virtual components according to the componentId. // vm._virtualComponents = {} var createVirtualComponent = function ( componentId , propsData ) { // create virtual component // const subVm = new VirtualComponent ( { componentId : componentId , propsData : propsData } ) ; // if (vm._virtualComponents) { //   vm._virtualComponents[componentId] = subVm // } } ; registerComponentHook ( cid , 'lifecycle' , 'create' , createVirtualComponent ) ; } , beforeDestroy : function beforeDestroy ( ) { delete this . _virtualComponents ; } } ) ; }
listening on native callback
listening on native callback